Delete include/ui_draw.h and include/ui_modal.h, which only re-exported ui_drawing_props.generated.h and the modal/title-bar props, and re-point kryon.h, ui_tree.h, ui_internal.h, and style_picker.kry at the props headers. Delete include/ui_image.h and send its includers to ui_image_props.generated.h; its only non-include content, KRY_IMAGE_CACHE_MAX, moves to the image host's ui_image_internal.h, and runtime/node2d_props.kry imports the props header directly. Gates: generated-runtime-parity-test, fast-test, runtime-declarations-check, k2c/k2cpp/k2go-syntax-test, go-runtime-test, examples-syntax-test, and kryon-boundary-check pass; the public-API snapshot is regenerated.
143 lines
2.4 KiB
Plaintext
143 lines
2.4 KiB
Plaintext
#module "node2d_props"
|
|
#import "kryon_compat.generated.h"
|
|
#import "ui_image_props.generated.h"
|
|
#import "kry_animation.h"
|
|
|
|
Body2DType :: enum {
|
|
Body2DStatic = 0
|
|
Body2DKinematic = 1
|
|
Body2DDynamic = 2
|
|
}
|
|
|
|
Shape2DKind :: enum {
|
|
Shape2DBox = 0
|
|
Shape2DCircle = 1
|
|
}
|
|
|
|
AudioKind :: enum {
|
|
AudioSound = 0
|
|
AudioMusic = 1
|
|
}
|
|
|
|
SceneProps :: struct {
|
|
time_scale: float
|
|
physics_enabled: i32
|
|
gravity: Vector2
|
|
}
|
|
|
|
Node2DProps :: struct {
|
|
position: Vector2
|
|
rotation: float
|
|
scale: Vector2
|
|
}
|
|
|
|
Camera2DProps :: struct {
|
|
zoom: float
|
|
rotation: float
|
|
active: i32
|
|
}
|
|
|
|
Sprite2DProps :: struct {
|
|
asset_path: const char*
|
|
source: Rectangle
|
|
size: Vector2
|
|
tint: Color
|
|
fit: ImageFit
|
|
}
|
|
|
|
Light2DProps :: struct {
|
|
radius: float
|
|
color: Color
|
|
energy: float
|
|
enabled: i32
|
|
}
|
|
|
|
Body2DProps :: struct {
|
|
body_type: Body2DType
|
|
fixed_rotation: i32
|
|
gravity_scale: float
|
|
body_id_index: i32
|
|
body_id_world: i16
|
|
body_id_gen: i16
|
|
}
|
|
|
|
CollisionShape2DProps :: struct {
|
|
shape_kind: Shape2DKind
|
|
size: Vector2
|
|
is_sensor: i32
|
|
}
|
|
|
|
Area2DProps :: struct {
|
|
monitoring: i32
|
|
last_enter_body: i32
|
|
last_exit_body: i32
|
|
}
|
|
|
|
AnimationPlayerProps :: struct {
|
|
anims: [4] Animation
|
|
anim_count: i32
|
|
current: i32
|
|
time: float
|
|
playing: i32
|
|
}
|
|
|
|
AnimatedSprite2DProps :: struct {
|
|
asset_path: const char*
|
|
frame_count: i32
|
|
frames_per_row: i32
|
|
frame_w: i32
|
|
frame_h: i32
|
|
fps: float
|
|
size: Vector2
|
|
tint: Color
|
|
time: float
|
|
}
|
|
|
|
TileMapProps :: struct {
|
|
asset_path: const char*
|
|
tile_w: i32
|
|
tile_h: i32
|
|
tiles_per_row: i32
|
|
map_w: i32
|
|
map_h: i32
|
|
tile_px_w: i32
|
|
tile_px_h: i32
|
|
tiles: const int*
|
|
tint: Color
|
|
}
|
|
|
|
AudioSourceProps :: struct {
|
|
asset_path: const char*
|
|
kind: AudioKind
|
|
volume: float
|
|
pitch: float
|
|
loop: i32
|
|
playing: i32
|
|
loaded: i32
|
|
handle: void*
|
|
}
|
|
|
|
ScenePropsDefault :: () -> SceneProps #export {
|
|
props: SceneProps
|
|
props.time_scale = 1.0
|
|
props.physics_enabled = 0
|
|
props.gravity.x = 0.0
|
|
props.gravity.y = 9.8
|
|
return props
|
|
}
|
|
|
|
SceneTimeScaleFor :: (time_scale: float) -> float #export {
|
|
if time_scale <= 0.0 { return 1.0 }
|
|
return time_scale
|
|
}
|
|
|
|
Node2DPropsDefault :: () -> Node2DProps #export {
|
|
props: Node2DProps
|
|
props.position.x = 0.0
|
|
props.position.y = 0.0
|
|
props.rotation = 0.0
|
|
props.scale.x = 1.0
|
|
props.scale.y = 1.0
|
|
return props
|
|
}
|