class Nya::GameObject

Defined in:

nya/object.cr

Constant Summary

NYA_REGISTERED = true
PROPERTIES = {"components" => "Array(Component)", "position" => "CrystalEdge::Vector3", "rotation" => "CrystalEdge::Vector3"} of String => String

Class Method Summary

Instance Method Summary

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

def self.deserialize(xml, ctx : SerializationContext | Nil = nil) #

[View source]
def self.transform_name(name) #

def self.xml_name #

Returns XML compatible name of a type (see Nya::Serializable.translate_type)


Instance Method Detail

def absolute_position #

[View source]
def absolute_rotation #

[View source]
def awake #
Description copied from class Nya::Container

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


[View source]
def children! #

[View source]
def components : Array(Nya::Component) #

[View source]
def components=(components : Array(Nya::Component)) #

[View source]
def find_component_of(type) #

Find component of given type Raises an exception if there is no such component


[View source]
def find_component_of?(type : U.class) forall U #

Find component of given type in this GameObject Returns nil if there's no such component


[View source]
def find_components_of(type : U.class) : Array(U) forall U #

Find all components of given type in this GameObject


[View source]
def 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


[View source]
def parent : Nya::GameObject? #

[View source]
def parent=(parent : Nil | Nya::GameObject) #

[View source]
def position : CrystalEdge::Vector3 #

[View source]
def position=(position : CrystalEdge::Vector3) #

[View source]
def render(tag : String | Nil = nil) #
Description copied from class Nya::Container

Renders object

Remember that you MUST call super in overridden method in order to make this work properly


[View source]
def rotation : CrystalEdge::Vector3 #

[View source]
def rotation=(rotation : CrystalEdge::Vector3) #

[View source]
def update #

[View source]