Click or drag to resize
LightSpriteBase Class
Provides functionality and extra properties for sprites that represent dynamic light sources.
Inheritance Hierarchy

Namespace: (Default Namespace)
Assembly: Default (in Default.exe) Version: 1.0.0.0
Syntax
C#
public abstract class LightSpriteBase : SpriteBase

The LightSpriteBase type exposes the following members.

Constructors
  NameDescription
Public methodLightSpriteBase
Construct a new light source sprite providing all the properties of the light source and the base sprite.
Top
Methods
  NameDescription
Public methodCode exampleAccelerateByInputs
Accelerate this sprite according to which directional inputs are on/pressed.
(Inherited from SpriteBase.)
Public methodCode exampleAddSpriteHere
Create a new (dynamic) instance of the specified sprite positioned such that HotSpot on the created sprite overlaps Location on this sprite.
(Inherited from SpriteBase.)
Public methodAlterXVelocity
Increment or decrement horizontal velocity
(Inherited from SpriteBase.)
Public methodAlterYVelocity
Increment or decrement vertical velocity
(Inherited from SpriteBase.)
Public methodAnimate
Advance the animation frame of this sprite according to its velocity or a constant rate.
(Inherited from SpriteBase.)
Public methodApplyLights
Use properties of the sprites in the specified category to configure real-time lighting on the display for the current frame.
(Inherited from GeneralRules.)
Public methodBlocked
Determines if the sprite is blocked from moving freely in a particular direction by solidity on the layer.
(Inherited from SpriteBase.)
Public methodCalculateRotatedState
Return a state that is in the same group of states as the sprite's current state, but possibly pointing a different direction.
(Inherited from SpriteBase.)
Public methodCanReturnToPreviousMap
Determines if there is a previous map to return to.
(Inherited from GeneralRules.)
Public methodChangeCounter
Change a counter's value with a pre-defined operation.
(Inherited from GeneralRules.)
Public methodClearAllMessages
Clears all active messages from the display.
(Inherited from GeneralRules.)
Public methodClearInputs
Turns off all current inputs on this sprite.
(Inherited from SpriteBase.)
Public methodClearOverlay
Turn off the overlay map.
(Inherited from GeneralRules.)
Public methodClearParameters
Resets all parameter values defined on the specific sprite definition to 0.
(Inherited from SpriteBase.)
Public methodClicked
Determines if the specified mouse button is pressed.
(Inherited from GeneralRules.)
Public methodDeactivate
Deactivate this sprite.
(Inherited from SpriteBase.)
Public methodDeactivateTargetSpriteFor
Deactivate the sprite currently selected as the target for the specified name and clear the sprite selected for that target name.
(Inherited from GeneralRules.)
Public methodDeleteSave
Empties the specified save slot.
(Inherited from GeneralRules.)
Public methodDragMap
When the mouse drags over the display, scroll the map along with it.
(Inherited from GeneralRules.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExcludeCounterFromSaveUnit
Exclude the specified counter from the SaveUnit that will be saved with the next call to SaveGame(Int32, Boolean).
(Inherited from GeneralRules.)
Public methodExcludeMapFromSaveUnit
Remove the specified map in from the SaveUnit that will be saved with the next call to SaveGame(Int32, Boolean).
(Inherited from GeneralRules.)
Public methodGenerateWalls
Calculate based on this sprite's solidity where light walls should appear within a specified radius.
Public methodGetBounds
Returns information about the visual boundaries of the sprite's currently displayed frame(s).
(Inherited from SpriteBase.)
Public methodGetCurrentFramesetFrames
Get a list of frameset frames that the sprite is currently displaying
(Inherited from SpriteBase.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetNearestSpriteIndex
Compute the index of the nearest active sprite from the specified category and return it.
(Inherited from SpriteBase.)
Public methodGetPolarStateByVector
Calculate the state that a rotating sprite should use in order to point in the direction it is currently traveling
(Inherited from SpriteBase.)
Public methodGetRandomNumber
Return a random number within a specified range.
(Inherited from GeneralRules.)
Public methodGetRelativePosition
Calculate the absolute position of a specified RelativePosition value with respect to this sprite.
(Inherited from SpriteBase.)
Public methodGetSelectedTargetFor
Returns the sprite currently selected for the specified target name.
(Inherited from GeneralRules.)
Public methodGetTargetParameterFor
Get the value of a numeric property or parameter on a sprite selected with SelectTargetSpriteFor(SpriteCollection, Int32, String).
(Inherited from GeneralRules.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIncludeCounterInSaveUnit
Include the specified counter in the SaveUnit that will be saved with the next call to SaveGame(Int32, Boolean).
(Inherited from GeneralRules.)
Public methodIncludeInSaveUnit
Includes a specified set of objects in the SaveUnit that will be saved with the next call to SaveGame(Int32, Boolean).
(Inherited from GeneralRules.)
Public methodIncludeMapInSaveUnit
Include the specified map in the SaveUnit that will be saved with the next call to SaveGame(Int32, Boolean).
(Inherited from GeneralRules.)
Public methodIsInputPressed
Determine if the specified input is being pressed for this sprite.
(Inherited from SpriteBase.)
Public methodIsInState
Determines if the sprite is in the specified range of states.
(Inherited from SpriteBase.)
Public methodIsKeyPressed
Determines if a specified key is being pressed.
(Inherited from GeneralRules.)
Public methodIsMapFlagOn
Determine if the specified map-specific flag on the current map is on.
(Inherited from GeneralRules.)
Public methodIsMouseButtonPressed
Determines if the specified mouse button is pressed.
(Inherited from GeneralRules.)
Public methodIsMoving
Determines if the sprite is moving in the specified direction at all.
(Inherited from SpriteBase.)
Public methodIsOnTile
Determines if a tile at the sprite's current position is a member of the specified category.
(Inherited from SpriteBase.)
Public methodIsPointBlocked
Determines if the specified point within a sprite is blocked from moving in a particular direction by the specified number of pixels.
(Inherited from SpriteBase.)
Public methodIsRidingPlatform
Determine if the sprite is riding another sprite
(Inherited from SpriteBase.)
Public methodIsSpriteForTargetOfType
Determine if the sprite selected for the specified target (selected with SelectTargetSpriteFor) is of the specified type.
(Inherited from GeneralRules.)
Public methodIsTargetSpriteSelectedFor (Inherited from GeneralRules.)
Public methodLandDownOnPlatform
Tests to see if this sprite is landing on a platform (from above), and if so, make the sprite ride the platform.
(Inherited from SpriteBase.)
Public methodLimitFrameRate
Limit the frame rate of the game to the specified number of frames per second. Call this only once per frame.
(Inherited from GeneralRules.)
Public methodLimitVelocity
If the velocity of the sprite is more than the specified maximum, normalize it so that it's going the same direction, but at no more that the specified maximum speed.
(Inherited from SpriteBase.)
Public methodLoadGame
Restore the state of the objects contained in the specified save slot.
(Inherited from GeneralRules.)
Public methodCode exampleLogDebugLabel
Write a string to the debug output without moving to the next line.
(Inherited from GeneralRules.)
Public methodCode exampleLogDebugValue
Write a number to the debug output and move to the next line.
(Inherited from GeneralRules.)
Public methodMapKeyToInput
Associates the state of the specified keyboard key with the specified input on this sprite.
(Inherited from SpriteBase.)
Public methodMapMouseToSprite
Move the sprite to the position of the mouse cursor and set the sprite's button inputs based on mouse button states.
(Inherited from SpriteBase.)
Public methodMapPlayerToInputs
Associate the state of the input device for the specified player with the inputs on this sprite.
(Inherited from SpriteBase.)
Public methodMoveByVelocity
Move this sprite according to its current velocity
(Inherited from SpriteBase.)
Public methodPolarAccelerate
Accelerate a rotating sprite in the direction that it is aiming.
(Inherited from SpriteBase.)
Public methodProcessRules
Execute the rules for this sprite if they have not already been executed this frame
(Inherited from SpriteBase.)
Public methodPushSprite
Alter the velocity of TargetSprite to plan to move out of the way of this sprite if TargetSprite is obstructing this sprite.
(Inherited from SpriteBase.)
Public methodPushSpriteIntoView
Alter this sprite's velocity so that it remains within the map's visible area or within the scroll margins, according to this sprite's layer's position within the map.
(Inherited from SpriteBase.)
Public methodPushTowardCategory
Push this sprite toward a sprite in the specified category.
(Inherited from SpriteBase.)
Public methodPushTowardSprite
Push this sprite toward a specified sprite.
(Inherited from SpriteBase.)
Public methodQuitGame
Quit the game by closing the main window.
(Inherited from GeneralRules.)
Public methodReactToInertia
Reduces the sprite's velocity to simulate friction.
(Inherited from SpriteBase.)
Public methodReactToPlatform
Adjust this sprite's velocity according to the motion of the platform it is riding
(Inherited from SpriteBase.)
Public methodReactToPush
Alter the velocity of this sprite to plan to move out of the way of sprites in Pushers if this sprite is obstructing sprites in Pushers.
(Inherited from SpriteBase.)
Public methodReactToPushback
Alter the velocity of this sprite to plan to move out of the way of sprites in Pushers but if this sprite is planning to overlap a sprite in Pushers, only after those sprites have processed their rules (usually to react to this sprite's pushing first).
(Inherited from SpriteBase.)
Public methodReactToSolid
Alter the sprite's velocity to react to solid areas on the map.
(Inherited from SpriteBase.)
Public methodRemoveFromCategories
Remove the sprite from its designated categories. USE ONLY on dynamically added sprites.
(Inherited from SpriteBase.)
Public methodResetLights
Reset all light sources to initial default behavior.
(Inherited from GeneralRules.)
Public methodReturnToPreviousMap
Return to the map that was active before the last SwitchToMap(Type, Boolean).
(Inherited from GeneralRules.)
Public methodRotateLight
Rotates the AimX and AimY of this light clockwise (+) or counterclockwise (-).
Public methodRotateVelocity
Redirect this sprite's velocity to be 100% in the direction that it is facing.
(Inherited from SpriteBase.)
Public methodSaveExists
Determines if saved game data exists in the specified slot.
(Inherited from GeneralRules.)
Public methodSaveGame
Save the current SaveUnit into the specified save slot.
(Inherited from GeneralRules.)
Public methodScrollSpriteIntoView
Scroll all layers on this sprite's layer's map so that the sprite is within visible area of the map.
(Inherited from SpriteBase.)
Public methodSelectLastCreatedSprite
Select the most recently created sprite to be the target of SetTargetParameter(String, Int32).
(Inherited from GeneralRules.)
Public methodSelectLastCreatedSpriteFor
Selects the most recently created sprite to be the target of SetTargetParameterFor(String, Int32, String) or GetTargetParameterFor(String, String).
(Inherited from GeneralRules.)
Public methodSelectTargetSprite
Selects a sprite within a collection, using a 0-based index, to be the target of SetTargetParameter(String, Int32).
(Inherited from GeneralRules.)
Public methodSelectTargetSpriteFor
Selects a sprite within a collection, using a 0-based index, to be the target of SetTargetParameterFor(String, Int32, String). TargetName allows any number of unique targets to be selected by assigning unique names.
(Inherited from GeneralRules.)
Public methodSetCategorySpriteState
Sets the current state of a sprite based on a category and index into the category.
(Inherited from GeneralRules.)
Public methodSetInputState
Turns on or off the specified input on this sprite.
(Inherited from SpriteBase.)
Public methodSetInputsTowardCategory
Set the state of the directional inputs on this sprite to move toward the specified sprite in a category.
(Inherited from SpriteBase.)
Public methodSetInputsTowardSprite
Set the state of the directional inputs on this sprite to move toward the specified sprite.
(Inherited from SpriteBase.)
Public methodSetMapFlag
Turn on or off a flag associated with the current map.
(Inherited from GeneralRules.)
Public methodSetMessageBackground
Sets the background for new messages added with ShowMessage(String).
(Inherited from GeneralRules.)
Public methodSetMessageDismissal
Determines which player and which button will dismiss newly created messages.
(Inherited from GeneralRules.)
Public methodSetMessageFont
Set the tileset used as the source for characters in messages.
(Inherited from GeneralRules.)
Public methodSetMessagePosition
Determines where newly created messages appear.
(Inherited from GeneralRules.)
Public methodSetOverlay
Set the overlay map.
(Inherited from GeneralRules.)
Public methodSetSolidity
Set the solidity rules to which the sprite is currently reacting.
(Inherited from SpriteBase.)
Public methodSetTargetMapFlag
Turn on or off a flag associated with the specified map.
(Inherited from GeneralRules.)
Public methodSetTargetParameter
Set the value of a numeric property or parameter on a sprite selected with SelectTargetSprite(SpriteCollection, Int32) to the specified value.
(Inherited from GeneralRules.)
Public methodSetTargetParameterFor
Set the value of a numeric property or parameter on a sprite selected with SelectTargetSpriteFor(SpriteCollection, Int32, String) to the specified value.
(Inherited from GeneralRules.)
Public methodSetViewLayout
Sets the layout of multiple views for the current map.
(Inherited from GeneralRules.)
Public methodShowMessage
Adds a message to the display.
(Inherited from GeneralRules.)
Public methodSnapToGround
Ensure the sprite stays in contact with the ground by altering its velocity to snap down onto the ground when it is close to the ground.
(Inherited from SpriteBase.)
Public methodStopRiding
Stop riding the sprite that this sprite is currently riding, if any.
(Inherited from SpriteBase.)
Public methodSwitchToMap
Sets a different map as the one to be drawn on the game display.
(Inherited from GeneralRules.)
Public methodSwitchToState
Switch the sprite to the the specified state, ensuring that the sprite doesn't hit a solid.
(Inherited from SpriteBase.)
Public methodTestCollisionMask
Determine whether the sprite's collision mask is overlapping part of any sprite in the specified category.
(Inherited from SpriteBase.)
Public methodTestCollisionRect(SpriteBase)
Determine if this sprite is planning to overlap the target sprite.
(Inherited from SpriteBase.)
Public methodTestCollisionRect(SpriteCollection)
Determine whether the solidity rectangle of the sprite overlaps that of any sprite in the specified category.
(Inherited from SpriteBase.)
Public methodTileActivateSprite
Activate the next inactive sprite from a category at the coordinates of a tile being touched by the sprite.
(Inherited from SpriteBase.)
Public methodTileAddSprite
Create a new (dynamic) instance of the specified sprite type at the coordinates of a tile being touched by the player.
(Inherited from SpriteBase.)
Public methodTileCategoryTouched
Determine if the sprite is touching a tile in the specified category (requires TouchTiles(TileCategoryName)).
(Inherited from SpriteBase.)
Public methodTileChange
Change tiles of the specified type that the sprite is touching to another tile (requires TouchTiles(TileCategoryName)).
(Inherited from SpriteBase.)
Public methodTileChangeTouched
Change the tile specified by TouchingIndex that is being touched by the sprite to another tile (requires TouchTiles(TileCategoryName)).
(Inherited from SpriteBase.)
Public methodTileTake
Determine if the sprite is touching the specified tile, and if so, "take" it and increment a counter (requires TouchTiles(TileCategoryName)).
(Inherited from SpriteBase.)
Public methodCode exampleTileTouchingIndex
Find the next unprocessed tile of the specified type (requires TouchTiles(TileCategoryName)).
(Inherited from SpriteBase.)
Public methodTileUseUp
Make the specified tile behave like it is "using up" one of the items tracked by the specified counter (requires TouchTiles(TileCategoryName)).
(Inherited from SpriteBase.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodCode exampleTouchTiles
Collects information about tiles the sprite is currently touching.
(Inherited from SpriteBase.)
Public methodUnloadBackgroundMaps
Unload all maps that aren't currently visible.
(Inherited from GeneralRules.)
Public methodUnloadMap
Unloads the specified map.
(Inherited from GeneralRules.)
Top
Fields
  NameDescription
Public fieldaimX
Horizontal offset relative to this sprite's location at which this light source points.
Public fieldaimY
Vertical offset relative to this sprite's location at which this light source points.
Public fieldaimZ
Depth offset relative to this sprite's location at which this light source points.
Public fieldapertureFocus
Determines whether and how light is focused in a particular direction.
Public fieldapertureSoftness
Determines how crisp the edges of the light cone are for lights directed by apertureFocus.
Public fieldcolor (Inherited from SpriteBase.)
Public fieldconstantFalloff
Constant falloff works in conjunction with linearFalloff and quadraticFalloff to determine how this light source extends over distance.
Public fielddx
Horizontal velocity of the sprite in pixels per frame
(Inherited from SpriteBase.)
Public fielddy
Vertical velocity of the sprite in pixels per frame
(Inherited from SpriteBase.)
Public fieldframe
Numeric value corresponding to the sprite's current frame.
(Inherited from SpriteBase.)
Public fieldinputs
Stores the inputs that are currently being "pressed" on this sprite.
(Inherited from SpriteBase.)
Public fieldisActive
Determines if this sprite is currently active.
(Inherited from SpriteBase.)
Public fieldlightZ
Depth position of this light source relative to the layer where the sprite resides.
Public fieldlinearFalloff
Linear falloff works in conjunction with constantFalloff and quadraticFalloff to determine how this light source extends over distance.
Public fieldLocalDX
Horizontal velocity relative to the sprite's environment (like a platform)
(Inherited from SpriteBase.)
Public fieldLocalDY
Vertical velocity relative to the sprite's environment
(Inherited from SpriteBase.)
Public fieldoldinputs
Remembers the inputs that were active on this sprite in the previous frame
(Inherited from SpriteBase.)
Public fieldoldX
The value of this sprite's x coordinate on the previous frame.
(Inherited from SpriteBase.)
Public fieldoldY
The value of this sprite's y coordinate on the previous frame.
(Inherited from SpriteBase.)
Public fieldProcessed
Determines if this sprite's definition's rules have been processed yet this frame
(Inherited from SpriteBase.)
Public fieldquadraticFalloff
Quadratic falloff works in conjunction with constantFalloff and linearFalloff to determine how this light source extends over distance.
Public fieldRidingOn
Stores the platform sprite (the sprite that this sprite rides on). If not set, then the sprite is not riding anything.
(Inherited from SpriteBase.)
Public fieldCode examplestate
Numeric value corresponding to the sprite's current state.
(Inherited from SpriteBase.)
Public fieldTouchedTiles
A collection of tiles being processed by TouchTiles(TileCategoryName) and other rules related to tile interactions.
(Inherited from SpriteBase.)
Public fieldx
Horizontal coordinate of the sprite within its layer.
(Inherited from SpriteBase.)
Public fieldy
Vertical coordinage of the sprite within its layer.
(Inherited from SpriteBase.)
Top
Properties
  NameDescription
Public propertyCurrentState
Retrieves information about the state that the sprite is currently in.
(Inherited from SpriteBase.)
Public propertyCurrentView
If multiple views are visible, this determines which view is currently active.
(Inherited from GeneralRules.)
Public propertyCode exampleItem
Returns information about a specified state of this sprite
(Inherited from SpriteBase.)
Public propertyModulateAlpha
Affects the sprite's visibility.
(Inherited from SpriteBase.)
Public propertyModulateBlue
Affects the output of blue when this sprite is drawn.
(Inherited from SpriteBase.)
Public propertyModulateGreen
Affects the output of green when this sprite is drawn.
(Inherited from SpriteBase.)
Public propertyModulateRed
Affects the output of red when this sprite is drawn.
(Inherited from SpriteBase.)
Public propertyOldPixelX
The horizontal pixel coordinate that the sprite was at on the previous frame
(Inherited from SpriteBase.)
Public propertyOldPixelY
The vertical pixel coordinate that the sprite was at on the previous frame
(Inherited from SpriteBase.)
Public propertyParentLayer
Retrieves information about the layer in which the sprite resides.
(Inherited from SpriteBase.)
Public propertyPixelX
Horizontal position of the sprite within the layer rounded toward zero to yield an integer.
(Inherited from SpriteBase.)
Public propertyPixelY
Vertical position of the sprite within the layer rounded toward zero to yield an integer.
(Inherited from SpriteBase.)
Public propertyProposedPixelX
The horizontal coordinate that the sprite is expected to be at on the next frame based on its current position and velocity, rounded toward zero to yield an integer pixel coordinate.
(Inherited from SpriteBase.)
Public propertyProposedPixelY
The vertical coordinate that the sprite is expected to be at on the next frame based on its current position and velocity, rounded toward zero to yield an integer pixel coordinate.
(Inherited from SpriteBase.)
Public propertySolidHeight
How many pixels high is the solid area of this sprite.
(Inherited from SpriteBase.)
Public propertySolidWidth
How many pixels wide is the solid area of this sprite.
(Inherited from SpriteBase.)
Public propertyStatic memberWallCoordinateCount
Returns how many coordinates were generated by the last call to GenerateWalls(Int32).
Public propertyStatic memberWallCoordinates
Provides access to the current set of light walls generated by GenerateWalls(Int32).
Top
See Also