sidescroller-framework

GameObject

SFramework extends upon some of the capability built into CraftStudio. The GameObject has gained a few new functions.

Contents

GameObject

Accessors

GameObject.spriteRenderer
GameObject.physics

GameObject:GetSpriteRenderer

Returns a reference to the SpriteRenderer behavior of the object

Example

local mySpriteRenderer = self.gameObject:GetSpriteRenderer()

GameObject:CreateSpriteRenderer

Creates a new SpriteRenderer

Arguments

GameObject:GetPhysics

Returns a reference to the Physics component of the object

Example

local myPhysics = self.gameObject:GetPhysics()

GameObject:AddPhysics

Adds a Physics component with default values to the object and returns a reference

Arguments