Project OutFox Wiki
Project OutFox home View the OutFox Wiki source on GitHub Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle 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

NameTypeAction
UpdateRatenumberDefines the update rate for the actorframe to update.
FOVnumberThe Field of View value for the items inside of the ActorFrame.
VanishXnumberSets the X vanish for the ActorFrame.
VanishYnumberSets the X vanish for the ActorFrame.
FarDistZnumberSets the Z draw distance for the ActorFrame.
LightingboolEnables 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.
NameTypeAction
AmbientColorcolorAmbient coloring for the ActorFrame.
DiffuseColorcolorDiffuse coloring for the ActorFrame.
SpecularColorcolorSpecular 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
}