Project OutFox Wiki
Project OutFox home View the OutFox Wiki source on GitHub Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

ActorFrame

ActorFrames can hold other actors. The Def. format is set up like any other lua table, allowing for creating actors in batches. Because of this, there are multiple ways to build an ActorFrame.

Def.ActorFrame{
    -- This sprite is now included inside of the ActorFrame.
    -- Any changes from the ActorFrame will affect the sprite, such as position, rotation,
    -- zoom and such.
    Def.Sprite{}
}

Attributes

Name Type Action
UpdateRate number Defines the update rate for the actorframe to update.
FOV number The Field of View value for the items inside of the ActorFrame.
VanishX number Sets the X vanish for the ActorFrame.
VanishY number Sets the X vanish for the ActorFrame.
FarDistZ number Sets the Z draw distance for the ActorFrame.
Lighting bool Enables lighting for the ActorFrame (unused).
The following require Lighting to be enabled. However, only the ambient color seems to work. This bug has been present since sm-ssc.
Name Type Action
AmbientColor color Ambient coloring for the ActorFrame.
DiffuseColor color Diffuse coloring for the ActorFrame.
SpecularColor color Specular coloring for the ActorFrame.
LightDirection {0,0,0} The direction of the lighting for the ActorFrame.

This actor inherits attributes from Actor.

Inline building

Actors can be explicitly placed into an ActorFrame like this:

Def.ActorFrame{
	Def.Actor{
		--Commands and stuff go here.
	},
	Def.Sprite{
		--More commands and stuff go here.
	}
}

Concatenation

Because lua tables can be concatenated (added) to each other, so can ActorFrames.

This can allow for programatically creating Actors in batches as needed.

However, if one does not plan on creating Actors programmaticly, then a simple return Def.ActorFrame{... is all that’s needed. Storing it into a local variable that gets returned will waste resources.

There are two ways to add onto an ActorFrame.

Method 1 (indexing)

local t = Def.ActorFrame{
	Def.Sprite{
		--commands & stuff
	},
	Def.BitmapText{
		--who even knows
	},
}

t[#t+1] = Def.Actor{
	--It's the third actor
}
return t

Method 2 (lua concatenation)

return Def.ActorFrame{
	Def.Sprite{
		--commands & stuff
	},
	Def.BitmapText{
		--who even knows
	},
} .. Def.Actor{
	--It's the third actor
}