Index

Package: Scenes

Description

package Widgets.Containers.Scenes is
Copyright (c) 2012 Kevin Wellwood All rights reserved. This source code is distributed under the Modified BSD License. For terms and conditions, see license.txt.

Classes

Scene (abstract)

type Scene is abstract new Container and Event_Listener with private;

Ancestors:

Immediate Children:

Widgets.Containers.Scenes.Keen.Keen_Scene

Primitive operations:

Activate_Popup (Inherited)
Add_Child (Inherited)
Add_Sprite
Apply_Container_Layout (Inherited)
Bring_To_Front (Inherited)
Bring_To_Front (Inherited)
Clear_Selection
Construct (Inherited)
Construct (overriding Construct)
Delete (overriding Delete)
Delete_Child (Inherited)
Delete_Children (overriding Delete_Children)
Delete_Sprite
Draw (Inherited)
Draw_Children (Inherited)
Draw_Content (overriding Draw_Content)
Draw_Layer_Overlay
Find_Widget_At (Inherited)
Get_Color (Inherited)
Get_Min_Height (overriding Get_Min_Height)
Get_Min_Width (overriding Get_Min_Width)
Get_Process_Name (Inherited)
Get_View (Inherited)
Get_Window (Inherited)
Give_Focus (Inherited)
Handle_Blur (Inherited)
Handle_Click (Inherited)
Handle_Descendant_Shown (Inherited)
Handle_Disabled (Inherited)
Handle_Enabled (Inherited)
Handle_Enter (Inherited)
Handle_Entity_Attribute_Changed
Handle_Entity_Created
Handle_Entity_Deleted
Handle_Entity_Moved
Handle_Entity_Resized
Handle_Event (overriding Handle_Event)
Handle_Exit (Inherited)
Handle_Focus (Inherited)
Handle_Frame_Changed
Handle_Key_Held (Inherited)
Handle_Key_Press (Inherited)
Handle_Key_Release (Inherited)
Handle_Mouse_Held (Inherited)
Handle_Mouse_Move (Inherited)
Handle_Mouse_Press (Inherited)
Handle_Mouse_Release (Inherited)
Handle_Mouse_Scroll (Inherited)
Handle_Resize (Inherited)
Handle_Rooted (Inherited)
Handle_Shown (Inherited)
Handle_Tile_Changed
Handle_World_Loaded
Handle_World_Property_Changed
Is_Rooted (Inherited)
Is_Showing (Inherited)
Pack (Inherited)
Remove_Child (Inherited)
Remove_Sprite
Set_Color (Inherited)
Set_Dirty (Inherited)
Set_Parent (Inherited)
Set_Selection
Set_Zoom (Inherited)
To_String (Inherited)
To_String (Inherited)
Translate_To_Content (Inherited)
Translate_To_Window (Inherited)
A Scene displays a graphical view of a game world as a layered map built from tiles. As a container widget, it contains Sprite widgets, each corresponding to a non-metaphysical entity in the world. The Scene's viewport generally shows only a portion of the world at a time and can be zoomed or scrolled, either manually or by following an entity.

Types

A_Scene

type A_Scene is access all Scene'Class;

Subprograms & Entries

Draw_Layer (abstract)

procedure Draw_Layer
( this: access Scene;
dc: Drawing_Context;
layer: Positive;
-- layer to draw startX, -- location in content coordinates startY: Integer;
-- to start drawing tileX1, -- range of the visible layer tileY1, -- in tile coordinates tileX2, -- tileY2: Integer -- ) is abstract;
Draws the range of tiles visible in the scene's viewport for layer 'layer' of the scene's map. The drawing location for the tile at 'tileX1','tileY1' is given by 'startX', 'startY'. Missing tiles should not drawn. All tiles in this layer are assumed to be opaque so transparency doesn't need to be handled when drawin. This procedure will be called per redraw per layer from background to foreground.

Get_Height_Tiles

function Get_Height_Tiles
( this: not null access Scene'Class ) return Natural;
Returns the height of the scene's map in tiles.

Get_Width_Tiles

function Get_Width_Tiles
( this: not null access Scene'Class ) return Natural;
Returns the width of the scene's map in tiles.

Scroll

procedure Scroll
( this: not null access Scene'Class;
x, y: Float );
Scrolls the viewport by x, y in world coordinates. If the scene is following an entity then scrolling will be constrained to the target by the slack distance.

Set_Selection

procedure Set_Selection
( this: access Scene;
child: A_Widget );
Passing null in 'child' will clear the selection.

Set_Target

procedure Set_Target
( this: access Scene;
target: Entity_Id );
Sets the scene's target entity, 'target', by Entity_Id. The scene will automatically scroll its viewport to keep the target entity in sight, constrained by a slack distance from dead center. If 'target' equals INVALID_ID then the scene will not follow an entity.

Unselect

procedure Unselect
( this: access Scene;
child: not null A_Widget );
Unselects 'child' widget, removing it from the set of selected children. This is not the same thing as input focus.