public abstract class GameExtension extends BaseExtension
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<java.lang.String,java.lang.Object> |
extensionGameProperties |
protected boolean |
isInstalledForGame |
authorName, category, classname, description, gameCenterName, icon, ID, internalVersion, isActive, isInGameCenter, isInMenu, isMenuItemInitiallyEnabled, menuName, name, properties, version, website
Constructor and Description |
---|
GameExtension() |
Modifier and Type | Method and Description |
---|---|
void |
clearDataForGame(stencyl.core.lib.Game game) |
java.io.File |
getDataFolder() |
java.io.File |
getExtrasFolder() |
stencyl.core.lib.Game |
getGame() |
int |
getVersionForGame(stencyl.core.lib.Game game) |
void |
installForGame()
Install this extension for the active game.
|
boolean |
isInstalledForGame(stencyl.core.lib.Game game) |
void |
onGameClosed(stencyl.core.lib.Game game)
Happens when a game is closed.
|
void |
onGameOpened(stencyl.core.lib.Game game)
Happens when a game is opened.
|
void |
onGameSave(stencyl.core.lib.Game game)
Happens when a game is saved.
|
abstract void |
onGameWithDataClosed() |
abstract void |
onGameWithDataOpened() |
abstract void |
onGameWithDataSaved() |
abstract void |
onInstalledForGame() |
abstract void |
onUninstalledForGame() |
protected void |
putGameProp(java.lang.String key,
java.lang.Object value)
Store a property for the active game.
|
protected boolean |
readBoolGameProp(java.lang.String key,
boolean defaultValue)
Read a boolean property for the active game.
|
protected double |
readDoubleGameProp(java.lang.String key,
double defaultValue)
Read a double property for the active game.
|
protected float |
readFloatGameProp(java.lang.String key,
float defaultValue)
Read a float property for the active game.
|
protected int |
readIntGameProp(java.lang.String key,
int defaultValue)
Read an integer property for the active game.
|
protected java.lang.String |
readStringGameProp(java.lang.String key,
java.lang.String defaultValue)
Read a string property for the active game.
|
void |
uninstallForGame()
Uninstall this extension for the active game
|
abstract void |
updateFromVersion(int fromVersion)
Use this method to run scripts for updating data when
the extension is updated.
|
disableMenu, doLongTask, enableMenu, extensionsReady, getAuthorName, getCategory, getClassname, getDescription, getDesignModeBlocks, getGameCenterName, getIcon, getID, getImageSaveRequest, getInternalVersion, getManifest, getMenuName, getName, getVersion, getWebsite, handlesImages, handlesSounds, hasOptions, hideProgressSpinner, isActive, isInGameCenter, isInMenu, isKitSpecific, isMenuItemInitiallyEnabled, onActivate, onDestroy, onGameBuild, onGameCenterActivate, onGameCreatedFromKit, onInstall, onOptions, onScreenCapture, onStartup, onUninstall, processImage, processSound, putProp, readBoolProp, readData, readDataAsBytes, readDoubleProp, readFloatProp, readIntProp, readStringProp, saveData, saveDataAsBytes, setActive, setAuthorName, setCategory, setDescription, setGameCenterCount, setGameCenterItem, setGameCenterName, setID, setInGameCenter, setInMenu, setInternalVersion, setManifest, setMenuItem, setMenuName, setMenuText, setName, setProgressMessage, setVersion, setWebsite, showInGameCenter, showMessageDialog, showOptions, showProgressSpinner, toString
protected boolean isInstalledForGame
protected java.util.HashMap<java.lang.String,java.lang.Object> extensionGameProperties
public java.io.File getDataFolder()
public java.io.File getExtrasFolder()
protected int readIntGameProp(java.lang.String key, int defaultValue)
key
- Property namedefaultValue
- Default value if the property doesn't existdefaultValue
protected double readDoubleGameProp(java.lang.String key, double defaultValue)
key
- Property namedefaultValue
- Default value if the property doesn't existdefaultValue
protected float readFloatGameProp(java.lang.String key, float defaultValue)
key
- Property namedefaultValue
- Default value if the property doesn't existdefaultValue
protected boolean readBoolGameProp(java.lang.String key, boolean defaultValue)
key
- Property namedefaultValue
- Default value if the property doesn't existdefaultValue
protected java.lang.String readStringGameProp(java.lang.String key, java.lang.String defaultValue)
key
- Property namedefaultValue
- Default value if the property doesn't existdefaultValue
protected void putGameProp(java.lang.String key, java.lang.Object value)
key
- Property namevalue
- The value to store.public int getVersionForGame(stencyl.core.lib.Game game)
game
- The game to checkpublic boolean isInstalledForGame(stencyl.core.lib.Game game)
game
- The game to checkpublic void installForGame()
public void uninstallForGame()
public void clearDataForGame(stencyl.core.lib.Game game)
game
- Delete extension data for this gamepublic abstract void onInstalledForGame()
public abstract void onUninstalledForGame()
public final void onGameOpened(stencyl.core.lib.Game game)
BaseExtension
onGameOpened
in class BaseExtension
game
- The game that was opened.public final void onGameSave(stencyl.core.lib.Game game)
BaseExtension
onGameSave
in class BaseExtension
game
- The game that was saved.public final void onGameClosed(stencyl.core.lib.Game game)
BaseExtension
onGameClosed
in class BaseExtension
game
- The game that was closed.public abstract void onGameWithDataOpened()
public abstract void onGameWithDataSaved()
public abstract void onGameWithDataClosed()
public abstract void updateFromVersion(int fromVersion)
fromVersion
- Previous internalVersion of extension used with this game.public stencyl.core.lib.Game getGame()