129 lines
2.8 KiB
C
129 lines
2.8 KiB
C
/* Generated by k2c from runtime/node2d_props.kry. */
|
|
#ifndef K_RUNTIME_NODE2D_PROPS_H
|
|
#define K_RUNTIME_NODE2D_PROPS_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#ifndef KIR_STRING_VALUE_DEFINED
|
|
#define KIR_STRING_VALUE_DEFINED
|
|
#include <stddef.h>
|
|
#include <string.h>
|
|
/* Immutable borrowed UTF-8 bytes; length preserves embedded nulls. */
|
|
typedef struct String { const char *data; size_t length; } String;
|
|
static inline String StringView(const char *data, size_t length) {
|
|
String value = {data, length};
|
|
return value;
|
|
}
|
|
static inline bool StringEqual(String a, String b) {
|
|
return a.length == b.length && (a.length == 0 || memcmp(a.data, b.data, a.length) == 0);
|
|
}
|
|
#endif
|
|
#include "kryon_compat.generated.h"
|
|
#include "ui_image.h"
|
|
#include "kry_animation.h"
|
|
|
|
typedef enum Body2DType {
|
|
Body2DStatic = 0,
|
|
Body2DKinematic = 1,
|
|
Body2DDynamic = 2,
|
|
} Body2DType;
|
|
|
|
typedef enum Shape2DKind {
|
|
Shape2DBox = 0,
|
|
Shape2DCircle = 1,
|
|
} Shape2DKind;
|
|
|
|
typedef enum AudioKind {
|
|
AudioSound = 0,
|
|
AudioMusic = 1,
|
|
} AudioKind;
|
|
|
|
typedef struct Camera2DProps {
|
|
float zoom;
|
|
float rotation;
|
|
int32_t active;
|
|
} Camera2DProps;
|
|
|
|
typedef struct Sprite2DProps {
|
|
const char* asset_path;
|
|
Rectangle source;
|
|
Vector2 size;
|
|
Color tint;
|
|
ImageFit fit;
|
|
} Sprite2DProps;
|
|
|
|
typedef struct Light2DProps {
|
|
float radius;
|
|
Color color;
|
|
float energy;
|
|
int32_t enabled;
|
|
} Light2DProps;
|
|
|
|
typedef struct Body2DProps {
|
|
Body2DType body_type;
|
|
int32_t fixed_rotation;
|
|
float gravity_scale;
|
|
int32_t body_id_index;
|
|
int16_t body_id_world;
|
|
int16_t body_id_gen;
|
|
} Body2DProps;
|
|
|
|
typedef struct CollisionShape2DProps {
|
|
Shape2DKind shape_kind;
|
|
Vector2 size;
|
|
int32_t is_sensor;
|
|
} CollisionShape2DProps;
|
|
|
|
typedef struct Area2DProps {
|
|
int32_t monitoring;
|
|
int32_t last_enter_body;
|
|
int32_t last_exit_body;
|
|
} Area2DProps;
|
|
|
|
typedef struct AnimationPlayerProps {
|
|
Animation anims[4];
|
|
int32_t anim_count;
|
|
int32_t current;
|
|
float time;
|
|
int32_t playing;
|
|
} AnimationPlayerProps;
|
|
|
|
typedef struct AnimatedSprite2DProps {
|
|
const char* asset_path;
|
|
int32_t frame_count;
|
|
int32_t frames_per_row;
|
|
int32_t frame_w;
|
|
int32_t frame_h;
|
|
float fps;
|
|
Vector2 size;
|
|
Color tint;
|
|
float time;
|
|
} AnimatedSprite2DProps;
|
|
|
|
typedef struct TileMapProps {
|
|
const char* asset_path;
|
|
int32_t tile_w;
|
|
int32_t tile_h;
|
|
int32_t tiles_per_row;
|
|
int32_t map_w;
|
|
int32_t map_h;
|
|
int32_t tile_px_w;
|
|
int32_t tile_px_h;
|
|
const int* tiles;
|
|
Color tint;
|
|
} TileMapProps;
|
|
|
|
typedef struct AudioSourceProps {
|
|
const char* asset_path;
|
|
AudioKind kind;
|
|
float volume;
|
|
float pitch;
|
|
int32_t loop;
|
|
int32_t playing;
|
|
int32_t loaded;
|
|
void* handle;
|
|
} AudioSourceProps;
|
|
|
|
#endif /* K_RUNTIME_NODE2D_PROPS_H */
|