Game Attribute > Setters

Version: Stencyl 4.0 or later
Prerequisite: create game attributes in Settings:  https://stencyl-nator.blogspot.com/p/settings.html
 
The snippets


In this case: 
game attribute name: gender 
game attribute type: String / text. 
game attribure value: osama bin laden. 

codes (Haxe)
Preview code in design mode: 
Engine.engine.setGameAttribute("gender", "osama bin laden");

shortcut 
Engine.engine.gameAttributes.set("gender", "osama bin laden");

No comments:

Post a Comment