Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

4.4 KB
Raw Blame
// Generated by raea-bevy-sdk from raea's Bevy App's TypeRegistry (aseprite (bevy_aseprite_ultra)); don't edit, regenerate
// (tools/bevy-plugins.sh gen). 3 component, 1 message.
// - In a scene (TSX): 3 wrappers, each a <BevyComponent> (or <BevyResource>) naming its type path, which raea-render
//   applies with ReflectComponent::insert. Put a component inside the <Mesh3d> it belongs to; <AsepriteSettings> sets the
//   plugin's resources.
// - In a TypeScript program (raea/bevy's BevyApp): `aseprite` holds a typed handle for every component,
//   resource, event, message and state, to spawn, insert, get, trigger, write, observe and set.
import { BevyComponent, BevyResource } from "raea/3d";
import { component, resource, event, message, state } from "raea/bevy";

/** bevy_aseprite_ultra::animation::AnimationEvents */
export type AnimationEvents =
  | { Finished: string | number /* an Entity: its bits, or in a Canvas3D a part's name or row id */ }
  | { LoopCycleFinished: string | number /* an Entity: its bits, or in a Canvas3D a part's name or row id */ };

/** bevy_aseprite_ultra::animation::PlayDirection */
export type PlayDirection =
  | "Forward"
  | "Backward";

/** bevy_aseprite_ultra::animation::AnimationState */
export interface AnimationState {
  relative_frame: number;
  current_frame: number;
  elapsed: { secs: number; nanos: number };
  current_direction: PlayDirection;
}

/** bevy_aseprite_ultra::animation::AnimationRepeat */
export type AnimationRepeat =
  | "Loop"
  | { Count: number };

/** bevy_aseprite_ultra::animation::AnimationDirection */
export type AnimationDirection =
  | "Forward"
  | "Reverse"
  | "PingPong"
  | "PingPongReverse";

/** bevy_aseprite_ultra::animation::Animation */
export interface Animation {
  tag: string | null;
  speed: number;
  playing: boolean;
  repeat: AnimationRepeat;
  direction: AnimationDirection | null;
  queue: ([string, AnimationRepeat])[];
  hold_relative_frame: boolean;
  relative_group: number;
  new_relative_group: number;
}

/** bevy_aseprite_ultra::animation::AseAnimation */
export interface AseAnimation {
  animation: Animation;
  aseprite: string | Record<string, unknown> /* bevy_asset::handle::Handle<bevy_aseprite_ultra::loader::Aseprite>: in a Canvas3D an asset path or the asset inline */;
}

/** bevy_aseprite_ultra::slice::AseSlice */
export interface AseSlice {
  name: string;
  aseprite: string | Record<string, unknown> /* bevy_asset::handle::Handle<bevy_aseprite_ultra::loader::Aseprite>: in a Canvas3D an asset path or the asset inline */;
}

/** bevy_aseprite_ultra::animation::AnimationState (component) */
export function AnimationState(props: { value: AnimationState; from?: number }) {
  return <BevyComponent type="bevy_aseprite_ultra::animation::AnimationState" value={props.value ?? null} from={props.from} />;
}

/** bevy_aseprite_ultra::animation::AseAnimation (component) */
export function AseAnimation(props: { value: AseAnimation; from?: number }) {
  return <BevyComponent type="bevy_aseprite_ultra::animation::AseAnimation" value={props.value ?? null} from={props.from} />;
}

/** bevy_aseprite_ultra::slice::AseSlice (component) */
export function AseSlice(props: { value: AseSlice; from?: number }) {
  return <BevyComponent type="bevy_aseprite_ultra::slice::AseSlice" value={props.value ?? null} from={props.from} />;
}

/** aseprite's settings: each one given is its resource, set at load (left out, the plugin's default). */
export function AsepriteSettings(props: {
  /* no reflected resources */
}) {
  return (
    <>

    </>
  );
}

/** Typed handles for a TypeScript App (raea/bevy): `app.spawn(with(aseprite.X, value))`, `app.trigger(aseprite.E, value)`. */
export const aseprite = {
  plugin: "aseprite" as const,
  /** bevy_aseprite_ultra::animation::AnimationEvents (message) */
  AnimationEvents: message<AnimationEvents>("bevy_aseprite_ultra::animation::AnimationEvents"),
  /** bevy_aseprite_ultra::animation::AnimationState (component) */
  AnimationState: component<AnimationState>("bevy_aseprite_ultra::animation::AnimationState"),
  /** bevy_aseprite_ultra::animation::AseAnimation (component) */
  AseAnimation: component<AseAnimation>("bevy_aseprite_ultra::animation::AseAnimation"),
  /** bevy_aseprite_ultra::slice::AseSlice (component) */
  AseSlice: component<AseSlice>("bevy_aseprite_ultra::slice::AseSlice"),
};

void BevyResource;
void BevyComponent;
void component;
void resource;
void event;
void message;
void state;