Property | Type | Description | |
---|---|---|---|
_backBufferSurface | IGraphicsSurface | ||
_screenSurface | IGraphicsSurface |
Method | Description | |
---|---|---|
AddBackgroundSlide ( ) : void |
Used to change the background slide of the Terrarium. Only a single background slide can be added with this revision.
|
|
AddComplexSizedSpriteSurface ( string name, int xFrames, int yFrames ) : void |
Add a complex sprite surface that takes advantage of sized sprites
|
|
AddComplexSpriteSurface ( string name, int xFrames, int yFrames ) : void |
Add a complex sprite surface given the number of frames.
|
|
AddSpriteSurface ( string name ) : void |
Adds a generic 10frame by 40frame sprite surface that is compatible with creature animation.
|
|
CenterTo ( int xOffset, int yOffset ) : void |
Controls scrolling of the viewport around the world map. Attempts to center the view to the defined point.
|
|
ClearProfiler ( ) : void |
Clear the profiler
|
|
CreateFullScreenSurfaces ( ) : bool |
Creates the surfaces required for full screen operation.
|
|
CreateWindowedSurfaces ( ) : bool |
Method used to create the necessary surfaces required for windowed mode.
|
|
CreateWorld ( int xPixels, int yPixels ) : |
Tell the game view to create a new world and reset the rendering surfaces.
|
|
InitializeGraphicEngine ( bool fullscreen ) : bool |
Initializes DirectDraw rendering APIs. The function can be called to initialize both Windowed and FullScreen mode, but FullScreen mode isn't fully implemented.
|
|
RenderFrame ( ) : void |
Renders a new frame of animation. This is the entry point for drawing code and is required every time a new frame is to be drawn.
|
|
ResizeViewer ( ) : bool |
Handles logic for resizing the game view
|
|
ScrollDown ( int pixels ) : int |
Controls scrolling of the viewport around the world map.
|
|
ScrollLeft ( int pixels ) : int |
Controls scrolling of the viewport around the world map.
|
|
ScrollRight ( int pixels ) : int |
Controls scrolling of the viewport around the world map.
|
|
ScrollUp ( int pixels ) : int |
Controls scrolling of the viewport around the world map.
|
|
SelectAnimalFromPoint ( Point p, bool selectThisAnimalOnly ) : void |
Attempts to select a creature given the world offset point.
|
|
TerrariumGameView ( ) : System |
Creates a new instance of the game view and initializes any properties.
|
|
UpdateWorld ( |
Updates the sprites controlled by the game view by providing a new world vector from the game engine.
|
Method | Description | |
---|---|---|
OnMouseEnter ( |
Overrides the OnMouseEnter event to provide custom cursor manipulation
|
|
OnMouseLeave ( |
Overrides the OnMouseLeave event to provide custom cursor manipulation
|
|
OnMouseMove ( MouseEventArgs e ) : void |
Overrides OnMouseMove to enable custom cursor rendering.
|
|
OnMouseUp ( MouseEventArgs e ) : void |
Overrides OnMouseUp in order to enable creature selection.
|
|
OnPaint ( PaintEventArgs e ) : void |
Overrides the Painting logic because painting will be handled using timers and DirectX. If the control is in design mode, then clear it because DirectX isn't available yet.
|
|
OnPaintBackground ( PaintEventArgs e ) : void |
Don't paint the background when a background erase is requested. Hurts performance and causes flicker.
|
Method | Description | |
---|---|---|
CheckScroll ( ) : void |
Computes whether scrolling should occur based on mouse location and hovering.
|
|
ClearBackground ( ) : void |
Clear any background surfaces to black. This helps find rendering artifacts where portions of a scene aren't updated. Since the background is cleared to black, the portions not updated are clearly visible.
|
|
ComputeCursorRectangle ( ) : |
||
GetBoundsOfState ( OrganismBase.OrganismState orgState ) : |
Uses the bounding box computation methods to compute a box that can be printed within the graphics engine. This is used for debugging creature pathing.
|
|
InitOrganism ( OrganismBase.OrganismState orgState ) : void |
Initializes a new organism state by computed and attaching a TerrariumSprite class that can be used to control on screen movement, animation skins, and selection.
|
|
InitTeleporter ( |
Sets up the hack table with teleporter information. The hack table is used to quickly implement new types of sprites or implement sprites linked to immutable objects (like the teleporter).
|
|
InitializeComponent ( ) : void |
Initialize Component
|
|
OnMiniMapUpdated ( Terrarium.Renderer.MiniMapUpdatedEventArgs e ) : void |
Helper function for firing the MiniMapUpdated event whenever a new mini-map becomes available.
|
|
OnOrganismClicked ( |
Helper function for firing the OrganismClicked event whenever an organism is selected within the game view.
|
|
PaintBackground ( ) : void |
Renders the Terrarium background image. Also renders plants on the background for static plant drawing to enable higher performance.
|
|
PaintCursor ( ) : void |
Paints a custom cursor rather than the default windows cursors. Can be used to enable cursor animation, but in the current revision simply paints a custom cursor based on mouse location.
|
|
PaintMessage ( ) : void |
Controls the rendering of textual messages to the Terrarium client screen. Since DrawText is invoked each time, this method is slow.
|
|
PaintSprites ( IGraphicsSurface surf, bool PlantsOnly ) : void |
Paint sprites on the given surface. This method is the meat of the graphics engine. Normally, creatures are painted to the work surface using this method. To increase performance plants are rendered to the background surface only once every 10 frames. Lots of work happening in this function so either read through the code or examine the Terrarium Graphics Engine whitepaper for more information.
|
|
ReInitSurfaces ( ) : void |
Reinitialize all surfaces after they have been lost. This method invokes the garbage collector to make sure that any COM references have been cleaned up, else surface renewal won't work correctly.
|
|
RenderTeleporter ( int lowZ, int highZ ) : void |
Renders any teleporters that exist between the given z ordered locations.
|
|
ResetTerrarium ( ) : void |
Resets the Terrarium and prepares it for a new world, without having to reboot the entire game.
|
|
TeleporterZIndex ( ) : int[] |
ZIndexes the teleporters so they can be properly rendered on the screen.
|
public AddComplexSizedSpriteSurface ( string name, int xFrames, int yFrames ) : void | ||
name | string | The name of the sprite sheet. |
xFrames | int | The number of frames width wise. |
yFrames | int | The number of frames height wise. |
return | void |
public AddComplexSpriteSurface ( string name, int xFrames, int yFrames ) : void | ||
name | string | The name of the sprite sheet. |
xFrames | int | The number of frames width-wise. |
yFrames | int | The number of frames height-wise. |
return | void |
public AddSpriteSurface ( string name ) : void | ||
name | string | The name of the sprite sheet. |
return | void |
public CenterTo ( int xOffset, int yOffset ) : void | ||
xOffset | int | X location to center to. |
yOffset | int | Y location to center to. |
return | void |
public CreateWorld ( int xPixels, int yPixels ) : |
||
xPixels | int | The number of world pixels |
yPixels | int | The number of world pixels |
return |
public InitializeGraphicEngine ( bool fullscreen ) : bool | ||
fullscreen | bool | If true then fullscreen will be enabled. |
return | bool |
protected OnMouseEnter ( |
||
e | Null | |
return | void |
protected OnMouseLeave ( |
||
e | Null | |
return | void |
protected OnMouseMove ( MouseEventArgs e ) : void | ||
e | MouseEventArgs | |
return | void |
protected OnMouseUp ( MouseEventArgs e ) : void | ||
e | MouseEventArgs | |
return | void |
protected OnPaint ( PaintEventArgs e ) : void | ||
e | PaintEventArgs | Graphics context objects |
return | void |
protected OnPaintBackground ( PaintEventArgs e ) : void | ||
e | PaintEventArgs | Graphics context objects |
return | void |
public ScrollDown ( int pixels ) : int | ||
pixels | int | The number of pixels to scroll down |
return | int |
public ScrollLeft ( int pixels ) : int | ||
pixels | int | The number of pixels to scroll left |
return | int |
public ScrollRight ( int pixels ) : int | ||
pixels | int | The number of pixels to scroll right |
return | int |
public ScrollUp ( int pixels ) : int | ||
pixels | int | The number of pixels to scroll up |
return | int |
public SelectAnimalFromPoint ( Point p, bool selectThisAnimalOnly ) : void | ||
p | Point | Point to check for creature intersection. |
selectThisAnimalOnly | bool | Determines if this creature should be added to the selection |
return | void |
public UpdateWorld ( |
||
worldVector | The new world vector of organisms. | |
return | void |
protected IGraphicsSurface _backBufferSurface | ||
return | IGraphicsSurface |