class Nya::GameObject
- Nya::GameObject
- Nya::Container
- Nya::Object
- Reference
- Object
Defined in:
nya/object.crConstant Summary
-
NYA_REGISTERED =
true
-
PROPERTIES =
{"components" => "Array(Component)", "position" => "CrystalEdge::Vector3", "rotation" => "CrystalEdge::Vector3"} of String => String
Class Method Summary
- .deserialize(xml, ctx : SerializationContext | Nil = nil)
- .transform_name(name)
-
.xml_name
Returns XML compatible name of a type (see
Nya::Serializable.translate_type
)
Instance Method Summary
- #absolute_position
- #absolute_rotation
-
#awake
Post-initializes object and its children
- #children!
- #components : Array(Nya::Component)
- #components=(components : Array(Nya::Component))
-
#find_component_of(type)
Find component of given type Raises an exception if there is no such component
-
#find_component_of?(type : U.class) forall U
Find component of given type in this GameObject Returns nil if there's no such component
-
#find_components_of(type : U.class) : Array(U) forall U
Find all components of given type in this GameObject
-
#find_in_children(type : U.class) : Array(U) forall U
Find components of given type recursively WARNING! This may be slow on big object structures, consider doing it in a separate fiber in that cases
- #parent : Nya::GameObject?
- #parent=(parent : Nil | Nya::GameObject)
- #position : CrystalEdge::Vector3
- #position=(position : CrystalEdge::Vector3)
-
#render(tag : String | Nil = nil)
Renders object
- #rotation : CrystalEdge::Vector3
- #rotation=(rotation : CrystalEdge::Vector3)
- #update
Instance methods inherited from class Nya::Container
awake
awake,
children : Array(Nya::Object)
children,
children=(children : Array(Nya::Object))
children=,
render(tag : String | Nil = nil)
render,
update
update
Constructor methods inherited from class Nya::Container
new(children : Array(Nya::Object))new new
Class methods inherited from class Nya::Container
deserialize(xml, ctx : SerializationContext | Nil = nil)
deserialize,
transform_name(name)
transform_name,
xml_name
xml_name
Instance methods inherited from class Nya::Object
ancestor_or_same?(u : U.class) forall U
ancestor_or_same?,
awake
awake,
backend
backend,
enabled : Bool
enabled,
enabled=(enabled : Bool)
enabled=,
enabled? : Bool
enabled?,
engine
engine,
id : String?
id,
id=(id : Nil | String)
id=,
matches_tag?(tag)
matches_tag?,
render(tag : String | Nil = nil)
render,
tag : String?
tag,
tag=(tag : Nil | String)
tag=,
update
update
Class methods inherited from class Nya::Object
deserialize(xml, ctx : SerializationContext | Nil = nil)
deserialize,
transform_name(name)
transform_name,
xml_name
xml_name
Class Method Detail
Instance Method Detail
Post-initializes object and its children
See Nya::Object#awake Remember that you MUST call super in overridden method in order to make this work properly
Find component of given type Raises an exception if there is no such component
Find component of given type in this GameObject Returns nil if there's no such component
Find all components of given type in this GameObject
Find components of given type recursively
WARNING ! This may be slow on big object structures, consider doing it in a separate fiber in that cases
Renders object
Remember that you MUST call super in overridden method in order to make this work properly