-
Notifications
You must be signed in to change notification settings - Fork 0
gameObject
Gentilhomme edited this page Aug 31, 2014
·
2 revisions
#Nouvelle index gameObject
La metatable gameObject contient désormais de nouvelle index. Ces index vont servir à raccourcir des commandes de tout les jours, par exemple :
-- Avant
self.gameObject.transform:GetPosition()
-- Maintenant
self.gameObject.Pos | Index | Indication |
|---|---|
| Pos | transform:GetPosition() |
| Localpos | transform:GetLocalPosition() |
| Scale | transform:GetLocalScale() |
| Angle | transform:GetEulerAngles() |
| Localangle | transform:GetLocalEulerAngles() |
| Orientation | transform:GetOrientation() |
| Localorientation | transform:GetLocalOrientation() |
| Name | GetName() |
| Parent | GetParent() |
| Children | GetChildren() |
| Scriptedbehavior | GetComponent("ScriptedBehavior") |
| Index | Indication |
|---|---|
| Getmodel | modelRenderer:GetModel() |
| Animation | modelRenderer:GetAnimation() |
| Animationtime | modelRenderer:GetAnimationTime() |
| Startanimation | modelRenderer:StartAnimationPlayback(true) |
| Stopanimation | modelRenderer:StopAnimationPlayback() |
| Isplay | modelRenderer:IsAnimationPlaying() |
| Modelopacity | modelRenderer:GetOpacity() |
| Index | Indication |
|---|---|
| Font | textRenderer:GetFont() |
| Text | textRenderer:GetText() |
| Alignment | textRenderer:GetAlignment() |
| Textwidth | textRenderer:GetTextWidth() |
| Textopacity | textRenderer:GetOpacity() |
| Index | Indication |
|---|---|
| TileSet | mapRenderer:GetTileSet() |
| Mapopacity | mapRenderer:GetOpacity() |
| Chunk | mapRenderer:GetChunkRenderDistance() |
| Index | Indication |
|---|---|
| LinearVelociy | physics:GetLinearVelocity() |
| AngularVelocity | physics:GetAngularVelocity() |
| Mass | physics:GetMass() |
| Friction | physics:GetFriction() |
Si vous souhaitez par exemple sélectionner l'enfant de nom "test" présent dans le gameObject. Ceci remplace FindChild()
local enfant = self.gameObject.Get("test")Télechargement de la framework : http://lib.antarka.com/UnitedFrameworks.zip