Click or drag to resize
Scrolling Game Development Kit Coding Reference Namespace

Projects are generated and compiled by the IDE in C# using a combination of code from the project's Source Code folder and code that is generated based on the content of the project. In order to facilitate writing code for the Source Code folder, and to better understand the rules provided by the Sprite Rule and Plan Rule systems, this reference provides detailed documentation of the structure of the generated project.

Classes
  ClassDescription
Public classActiveSpriteEnumerator
Enumerates only the currently active sprites on a layer
Public classAnimTile
Represents the definition for an animated tile in a tileset
Public classByteLayer
Represents a layer where each tile is represented as a single byte.
Public classCollisionMask
Defines the shape of a sprite for the purpose of collision detection with other sprites
Public classControllerPlayer
Represents interactions between the game and a player via a joystick/gamepad
Public classCounter
Represents a numeric counter defined in the project
Public classCounterRef
This class provides a kind of indirect reference to a counter for the purposes of saving and loading counter values in a SaveUnit.
Public classDisplay
Manages the display device on which real-time game graphics are drawn
Public classDisplayTextureRef
Object used to refer to a texture (graphic sheet) managed by a particular Display.
Public classDisplayRef
Provides serialization "services" for the Display object, preventing attempts to save or load data for the display object when the game is saved/loaded.
Public classDownCeilingTileShape
Represents a "downward ceiling" shape with a slope leading from the upper left corner to the lower right corner with the upper right half of the tile being solid.
Public classDownhillLeftTileShape
Represents the left half of a gradual "downhill" tile with a slope leading from the upper left corner to the middle right with the lower portion of the tile being solid.
Public classDownhillRightTileShape
Represents the right half of a gradual "downhill" tile with a slope leading from the middle left to the lower right corner with the lower portion of the tile being solid.
Public classDownhillTileShape
Represents a "downhill" shape with a slope leading from the upper left corner to the lower right corner with the lower left half of the tile being solid.
Public classEmptyTile
Represents a tile that doesn't draw anything onto the layer
Public classEmptyTileShape
Represents an empty tile (nothing solid)
Public classFrameset
Provides objects that encapsulate the functionality of the framesets defined at design time.
Public classFramesetRef
Provides serialization services for Frameset to allow objects that reference framesets to be saved without saving everything that is referenced by the frameset.
Public classfrmAbout
About dialog displayed from game's help menu.
Public classfrmControls
UI to support the player's customization of input device.
Public classGameForm
UI that contains and manages the main display for the game.
Public classGeneralRules
Implements rules common to sprites and plans
Public classGeneralRulesMessageLayer
Represents a message created and displayed by ShowMessage(String).
Public classIntLayer
Represents a layer where each tile is represented as a 32-bit integer.
Public classJoystick
Public classKeyboardPlayer
Represents interactions between the game and a player via the keyboard
Public classKeyboardState
Public classLayerBase
Defines the basic operation of a layer of tiles and sprites within a map.
Public classLayerSpriteCategoriesBase
Provides categorized access to sprite within a layer for all categories defined in the project
Public classLightSpriteBase
Provides functionality and extra properties for sprites that represent dynamic light sources.
Public classMapBase
Base class for all maps.
Public classNew_Map_1_Map
Public classPlanBase
Base class for "plans", which consist of map coordinates and rules
Public classProject
This class provides global, static data. No instances are created.
Public classSaveUnit
Retains information about what has been included for a saved game.
Public classShader
Encapsulates a single OpenGL shader, for example, a fragment shader or vertex shader.
Public classShaderException
Encapsulates an error occurring while compiling or linking an OpenGL shader.
Public classShaderProgram
Encapsulates an OpenGL shader program including, for example, both vertex and fragment shaders
Public classShortLayer
Represents a layer where each tile is represented as a 16-bit integer.
Public classSimpleTile
Represents a non-animated composite or single-cell tile
Public classSolidity
Represents solidity definitions in the project
Public classSolidTileShape
Represents a solid tile (flat solid on all 4 sides)
Public classSpriteBase
Base class for all sprite definitions.
Public classSpriteBaseTouchedTile
Tracks information about a tile for the purposes of processing interactions between a sprite and a tile that it is touching.
Public classSpriteCollection
Categorizes / collects sprite instances
Public classSpriteFrame
This specialization of TileFrame is used specifically for sprite frames with collision masks (when mask alpha level is non-zero).
Public classSpriteState
Represents one state within a sprite definition, primarily defining how a it can animate.
Public classTileBase
Maps a tile index to frameset frames based on counter values etc
Public classTileCategoryFrameMembership
Represents membership information for a tile whose membership changes based on which frame is active.
Public classTileCategoryMembershipBase
Stores information about which categories a tile is in.
Public classTileCategorySimpleMembership
Represents membership information in which the membership of a tile does not change based on its state.
Public classTileFrame
Represents the appearance of a tile during one iteration of the game loop.
Public classTileset
Represents tilesets defined in the project
Public classTilesetRef
Provides serialization services for Tileset to allow classes that reference a tileset to be saved to a file without writing all the data internal to the tileset
Public classTileShape
Defines a particular shape that a tile can have at any/all sizes
Public classTopSolidTileShape
Represents a tile that is only solid from above. A sprite can move freely through this tile in any direction unless the sprite is fully above the tile in which case it cannot penetrate the top.
Public classUpCeilingTileShape
Represents an "upward ceiling" shape with a slope leading from the lower left corner to the upper right corner with the upper left half of the tile being solid.
Public classUphillLeftTileShape
Represents the left half of a gradual "uphill" tile with a slope leading from the lower left corner to the middle right with the lower portion of the tile being solid.
Public classUphillRightTileShape
Represents the right half of a gradual "uphill" tile with a slope leading from the middle left to the upper right corner with the lower portion of the tile being solid.
Public classUphillTileShape
Represents an "uphill" shape with a slope leading from the lower left corner to the upper right corner with the lower right half of the tile being solid.
Public classWinKeyboard
Represents the current state of all keys on the keyboard.
Structures
  StructureDescription
Public structureFrame
An instance of the Frame class represents one image from a frameset.
Public structurePlanBaseCoordinate
Stores information about a coordinate within a PlanBase.
Public structureSolidityMapping
Associates a category of tiles with a solidity shape to which sprites can react.
Public structureTileFrameMembership
Defines an object that can be used to provide information to the construction of a TileCategoryFrameMembership.
Interfaces
  InterfaceDescription
Public interfaceIKeyboard
Public interfaceIPlayer
Defines a common interface by which a sprite can receive input from a player or some object simulating a player.
Delegates
  DelegateDescription
Public delegateGameFormSimpleNotification
Defines a mechanism by which simple notifications without any data can be triggered.
Enumerations
  EnumerationDescription
Public enumerationCounterOperation
Specifies an operation to perform on a counter.
Public enumerationGameDisplayMode
Specifies a size, color depth and scaling factor for a display.
Public enumerationGeneralRulesButtonSpecifier
Specifies a button or buttons on a player's input controller.
Public enumerationGeneralRulesMessageView
Determines in which view(s) a message will appear.
Public enumerationKey
Identifies a key on the keyboard.
Public enumerationLightingMode
Determines whether lighting is enabled or disabled.
Public enumerationPlanBaseColorChannel
Specifies one of the 4 color channels: alpha, red, green or blue.
Public enumerationPlanBaseDrawStyle
Public enumerationRelativePosition
Refers to the position of a predefined point relative to a rectangle
Public enumerationSaveUnitInclusion
This is used to specify general categories of objects to be included in a saved game (save unit).
Public enumerationShaderShaderCode
Enumerates all the pre-implemented shaders provided by SGDK2
Public enumerationSpriteBaseDirection
Used to refer to 4 primary directions.
Public enumerationSpriteBaseInputBits
Contains all the possible bits that can be set in a sprite's inputs and oldinputs properties.
Public enumerationSpriteBaseSpriteAnimationType
Defines the basis for a sprite's animation
Public enumerationTileCategoryName
Provides an enumerated list of every tile category defined in the project.
Public enumerationViewLayout
Specifies an arrangement for multiple scrolling views on a single display
Remarks

Some useful places to start:

PageDescription
SpriteBaseLists all properties and methods that are immediately available on the Sprite Definition Rules tab. From here you can see a summary of all the functions available and easily link to detailed descriptions of how each sprite rule function can be used.
PlanBaseLists all properties and methods that are immediately available when defining plan rules in the plan editor. From here you can see a summary of all the functions available and easily link to detailed descriptions of how each plan rule function can be used.

Of course there is much more to the API reference, but these are the most frequently used starting points even for those who aren't doing any formal coding, just to understand how to define rules.

When using the coding reference primarily to understand how to use the various sprite and plan rule functions, it's important to understand how the UI for entering rules corresponds to the code. The following examples should clarify this.

Rule Definition (for Sprite Definition)

Corresponding Generated Code

Generated in Sprites\Player.cs (for sprite named "Player") in function "ExecuteRules":

// Show player 1 grape points
TempNum = this.TileActivateSprite(0, ParentLayer.m_SpriteCategories.Points, true);

Rule Definition (for Plan)

Corresponding Generated Code

Generated in Level_1_Map.cs (for a plan in a map named "Level 1") in class "Main_Lyr" (for a layer named "Main") in a nested class named "ManagePlayers" (for a plan named "ManagePlayers") in function "ExecuteRules":

// If 2 players
if ((Counter.Players.CurrentValue >= 2))
{