pxl8/src/lua/pxl8.lua

229 lines
7.3 KiB
Lua
Raw Normal View History

local anim = require("pxl8.anim")
local bytes = require("pxl8.bytes")
local core = require("pxl8.core")
2026-01-21 23:19:50 -06:00
local effects = require("pxl8.effects")
2026-02-02 17:48:25 -06:00
local gfx = require("pxl8.gfx")
local gui = require("pxl8.gui")
local input = require("pxl8.input")
2026-01-21 23:19:50 -06:00
local math = require("pxl8.math")
local net = require("pxl8.net")
local particles = require("pxl8.particles")
2026-01-21 23:19:50 -06:00
local procgen = require("pxl8.procgen")
local sfx = require("pxl8.sfx")
local tilemap = require("pxl8.tilemap")
local transition = require("pxl8.transition")
local world = require("pxl8.world")
local pxl8 = {}
core.init(pxl8_gfx, pxl8_input, pxl8_rng, pxl8_sfx, pxl8_sys)
pxl8.get_fps = core.get_fps
pxl8.get_height = core.get_height
pxl8.get_title = core.get_title
pxl8.get_width = core.get_width
pxl8.info = core.info
pxl8.warn = core.warn
pxl8.error = core.error
pxl8.debug = core.debug
pxl8.trace = core.trace
pxl8.quit = core.quit
2026-01-21 23:19:50 -06:00
pxl8.hash32 = math.hash32
pxl8.rng_f32 = core.rng_f32
2026-01-21 23:19:50 -06:00
pxl8.rng_next = core.rng_next
pxl8.rng_range = core.rng_range
2026-01-21 23:19:50 -06:00
pxl8.rng_seed = core.rng_seed
pxl8.find_color = core.find_color
pxl8.palette_color = core.palette_color
pxl8.palette_index = core.palette_index
pxl8.ramp_index = core.ramp_index
2026-01-21 23:19:50 -06:00
pxl8.set_colormap = core.set_colormap
pxl8.set_palette = core.set_palette
pxl8.set_palette_rgb = core.set_palette_rgb
2026-01-21 23:19:50 -06:00
pxl8.update_palette_deps = core.update_palette_deps
2026-02-02 17:48:25 -06:00
pxl8.clear = gfx.clear
pxl8.pixel = gfx.pixel
pxl8.line = gfx.line
pxl8.rect = gfx.rect
pxl8.rect_fill = gfx.rect_fill
pxl8.circle = gfx.circle
pxl8.circle_fill = gfx.circle_fill
pxl8.text = gfx.text
pxl8.sprite = gfx.sprite
pxl8.load_palette = gfx.load_palette
pxl8.load_sprite = gfx.load_sprite
pxl8.create_texture = gfx.create_texture
pxl8.gfx_color_ramp = gfx.color_ramp
pxl8.gfx_fade_palette = gfx.fade_palette
pxl8.gfx_cycle_palette = gfx.cycle_palette
pxl8.add_palette_cycle = gfx.add_palette_cycle
pxl8.remove_palette_cycle = gfx.remove_palette_cycle
pxl8.set_palette_cycle_speed = gfx.set_palette_cycle_speed
pxl8.clear_palette_cycles = gfx.clear_palette_cycles
pxl8.push_target = gfx.push_target
pxl8.pop_target = gfx.pop_target
pxl8.key_down = input.key_down
pxl8.key_pressed = input.key_pressed
pxl8.key_released = input.key_released
pxl8.mouse_dx = input.mouse_dx
pxl8.mouse_dy = input.mouse_dy
pxl8.mouse_wheel_x = input.mouse_wheel_x
pxl8.mouse_wheel_y = input.mouse_wheel_y
pxl8.mouse_x = input.mouse_x
pxl8.mouse_y = input.mouse_y
pxl8.get_mouse_pos = input.get_mouse_pos
pxl8.mouse_pressed = input.mouse_pressed
pxl8.mouse_released = input.mouse_released
pxl8.center_cursor = input.center_cursor
pxl8.set_cursor = input.set_cursor
pxl8.set_relative_mouse_mode = input.set_relative_mouse_mode
pxl8.Anim = anim.Anim
pxl8.create_anim = anim.Anim.new
pxl8.create_anim_from_ase = anim.Anim.from_ase
2026-01-21 23:19:50 -06:00
pxl8.bounds = math.bounds
2026-02-02 17:48:25 -06:00
pxl8.Camera3D = gfx.Camera3D
pxl8.Material = gfx.Material
pxl8.Mesh = gfx.Mesh
pxl8.begin_frame_3d = gfx.begin_frame_3d
pxl8.clear_3d = gfx.clear_3d
pxl8.clear_depth = gfx.clear_depth
pxl8.create_camera_3d = gfx.Camera3D.new
pxl8.create_material = gfx.create_material
pxl8.create_mesh = gfx.Mesh.new
pxl8.create_vec3_array = gfx.create_vec3_array
pxl8.draw_line_3d = gfx.draw_line_3d
pxl8.draw_mesh = gfx.draw_mesh
pxl8.end_frame_3d = gfx.end_frame_3d
pxl8.project_points = gfx.project_points
pxl8.set_wireframe = gfx.set_wireframe
pxl8.get_wireframe = gfx.get_wireframe
2026-01-21 23:19:50 -06:00
pxl8.Lights = effects.Lights
pxl8.create_lights = effects.Lights.new
pxl8.Compressor = sfx.Compressor
pxl8.create_compressor = sfx.Compressor.new
pxl8.Delay = sfx.Delay
pxl8.create_delay = sfx.Delay.new
pxl8.Reverb = sfx.Reverb
pxl8.create_reverb = sfx.Reverb.new
pxl8.Gui = gui.Gui
pxl8.create_gui = gui.Gui.new
pxl8.gui_label = gui.label
pxl8.gui_window = gui.window
2026-01-21 23:19:50 -06:00
pxl8.mat4_identity = math.mat4_identity
pxl8.mat4_lookat = math.mat4_lookat
pxl8.mat4_multiply = math.mat4_multiply
pxl8.mat4_multiply_vec3 = math.mat4_multiply_vec3
pxl8.mat4_multiply_vec4 = math.mat4_multiply_vec4
pxl8.mat4_orthographic = math.mat4_orthographic
pxl8.mat4_perspective = math.mat4_perspective
pxl8.mat4_rotate_x = math.mat4_rotate_x
pxl8.mat4_rotate_y = math.mat4_rotate_y
pxl8.mat4_rotate_z = math.mat4_rotate_z
pxl8.mat4_scale = math.mat4_scale
pxl8.mat4_translate = math.mat4_translate
2026-01-25 09:26:30 -06:00
pxl8.get_net = net.get
pxl8.pack_f32_be = bytes.pack_f32_be
pxl8.pack_f32_le = bytes.pack_f32_le
pxl8.pack_f64_be = bytes.pack_f64_be
pxl8.pack_f64_le = bytes.pack_f64_le
pxl8.pack_i8 = bytes.pack_i8
pxl8.pack_i16_be = bytes.pack_i16_be
pxl8.pack_i16_le = bytes.pack_i16_le
pxl8.pack_i32_be = bytes.pack_i32_be
pxl8.pack_i32_le = bytes.pack_i32_le
pxl8.pack_i64_be = bytes.pack_i64_be
pxl8.pack_i64_le = bytes.pack_i64_le
pxl8.pack_u8 = bytes.pack_u8
pxl8.pack_u16_be = bytes.pack_u16_be
pxl8.pack_u16_le = bytes.pack_u16_le
pxl8.pack_u32_be = bytes.pack_u32_be
pxl8.pack_u32_le = bytes.pack_u32_le
pxl8.pack_u64_be = bytes.pack_u64_be
pxl8.pack_u64_le = bytes.pack_u64_le
pxl8.Particles = particles.Particles
pxl8.create_particles = particles.Particles.new
2026-01-21 23:19:50 -06:00
pxl8.Graph = procgen.Graph
pxl8.create_graph = procgen.create_graph
pxl8.PROCGEN_ROOMS = world.PROCGEN_ROOMS
pxl8.PROCGEN_TERRAIN = world.PROCGEN_TERRAIN
pxl8.SfxContext = sfx.SfxContext
pxl8.SfxNode = sfx.SfxNode
pxl8.create_sfx_context = sfx.SfxContext.new
pxl8.sfx_get_master_volume = sfx.get_master_volume
pxl8.sfx_note_to_freq = sfx.note_to_freq
pxl8.sfx_set_master_volume = sfx.set_master_volume
pxl8.sfx_voice_params = sfx.voice_params
pxl8.SFX_FILTER_BANDPASS = sfx.FILTER_BANDPASS
pxl8.SFX_FILTER_HIGHPASS = sfx.FILTER_HIGHPASS
pxl8.SFX_FILTER_LOWPASS = sfx.FILTER_LOWPASS
pxl8.SFX_FILTER_NONE = sfx.FILTER_NONE
pxl8.SFX_LFO_AMPLITUDE = sfx.LFO_AMPLITUDE
pxl8.SFX_LFO_FILTER = sfx.LFO_FILTER
pxl8.SFX_LFO_PITCH = sfx.LFO_PITCH
pxl8.SFX_NODE_COMPRESSOR = sfx.NODE_COMPRESSOR
pxl8.SFX_NODE_DELAY = sfx.NODE_DELAY
pxl8.SFX_NODE_REVERB = sfx.NODE_REVERB
pxl8.SFX_WAVE_NOISE = sfx.WAVE_NOISE
pxl8.SFX_WAVE_PULSE = sfx.WAVE_PULSE
pxl8.SFX_WAVE_SAW = sfx.WAVE_SAW
pxl8.SFX_WAVE_SINE = sfx.WAVE_SINE
pxl8.SFX_WAVE_SQUARE = sfx.WAVE_SQUARE
pxl8.SFX_WAVE_TRIANGLE = sfx.WAVE_TRIANGLE
pxl8.TILE_FLIP_X = tilemap.TILE_FLIP_X
pxl8.TILE_FLIP_Y = tilemap.TILE_FLIP_Y
pxl8.TILE_SOLID = tilemap.TILE_SOLID
pxl8.TILE_TRIGGER = tilemap.TILE_TRIGGER
pxl8.Tilemap = tilemap.Tilemap
pxl8.create_tilemap = tilemap.Tilemap.new
pxl8.Tilesheet = tilemap.Tilesheet
pxl8.create_tilesheet = tilemap.Tilesheet.new
pxl8.Transition = transition.Transition
pxl8.create_transition = transition.Transition.new
pxl8.TRANSITION_TYPES = transition.TYPES
pxl8.unpack_f32_be = bytes.unpack_f32_be
pxl8.unpack_f32_le = bytes.unpack_f32_le
pxl8.unpack_f64_be = bytes.unpack_f64_be
pxl8.unpack_f64_le = bytes.unpack_f64_le
pxl8.unpack_i8 = bytes.unpack_i8
pxl8.unpack_i16_be = bytes.unpack_i16_be
pxl8.unpack_i16_le = bytes.unpack_i16_le
pxl8.unpack_i32_be = bytes.unpack_i32_be
pxl8.unpack_i32_le = bytes.unpack_i32_le
pxl8.unpack_i64_be = bytes.unpack_i64_be
pxl8.unpack_i64_le = bytes.unpack_i64_le
pxl8.unpack_u8 = bytes.unpack_u8
pxl8.unpack_u16_be = bytes.unpack_u16_be
pxl8.unpack_u16_le = bytes.unpack_u16_le
pxl8.unpack_u32_be = bytes.unpack_u32_be
pxl8.unpack_u32_le = bytes.unpack_u32_le
pxl8.unpack_u64_be = bytes.unpack_u64_be
pxl8.unpack_u64_le = bytes.unpack_u64_le
2026-01-25 09:26:30 -06:00
pxl8.Bsp = world.Bsp
pxl8.Chunk = world.Chunk
pxl8.CHUNK_BSP = world.CHUNK_BSP
pxl8.CHUNK_VXL = world.CHUNK_VXL
pxl8.World = world.World
2026-01-25 09:26:30 -06:00
pxl8.get_world = world.World.get
return pxl8