Index

Package: Scenes

Description

package Widgets.Containers.Scenes is

Classes

Scene (abstract)

type Scene is abstract new Container and Event_Listener with private;

Ancestors:

Immediate Children:

Primitive operations:

Add (overriding Widgets.Containers.Add)
Clear_Selection
Construct (overriding Widgets.Construct)
Delete (overriding Widgets.Containers.Delete)
Delete_Child (overriding Widgets.Containers.Delete_Child)
Delete_Children (overriding Widgets.Containers.Delete_Children)
Draw_Content (overriding Widgets.Containers.Draw_Content)
Draw_Layer_Overlay
Events.Listeners.To_String (Inherited)
Get_Min_Height (overriding Widgets.Get_Min_Height)
Get_Min_Width (overriding Widgets.Get_Min_Width)
Handle_Entity_Attribute_Changed
Handle_Entity_Created
Handle_Entity_Deleted
Handle_Entity_Moved
Handle_Entity_Resized
Handle_Event (overriding Events.Listeners.Handle_Event)
Handle_Frame_Changed
Handle_Tile_Changed
Handle_World_Loaded
Handle_World_Property_Changed
Objects.Construct (Inherited)
Remove (overriding Widgets.Containers.Remove)
Set_Selection
Widgets.Activate_Popup (Inherited)
Widgets.Bring_To_Front (Inherited)
Widgets.Containers.Apply_Container_Layout (Inherited)
Widgets.Containers.Bring_To_Front (Inherited)
Widgets.Containers.Draw (Inherited)
Widgets.Containers.Draw_Children (Inherited)
Widgets.Containers.Find_Widget (Inherited)
Widgets.Containers.Handle_Ancestor_Hidden (Inherited)
Widgets.Containers.Handle_Ancestor_Unhidden (Inherited)
Widgets.Containers.Handle_Resize (Inherited)
Widgets.Containers.Pack (Inherited)
Widgets.Containers.Set_Zoom (Inherited)
Widgets.Get_Color (Inherited)
Widgets.Get_Process_Name (Inherited)
Widgets.Get_View (Inherited)
Widgets.Get_Window (Inherited)
Widgets.Handle_Blur (Inherited)
Widgets.Handle_Click (Inherited)
Widgets.Handle_Descendant_Hidden (Inherited)
Widgets.Handle_Descendant_Unhidden (Inherited)
Widgets.Handle_Disabled (Inherited)
Widgets.Handle_Enabled (Inherited)
Widgets.Handle_Enter (Inherited)
Widgets.Handle_Exit (Inherited)
Widgets.Handle_Focus (Inherited)
Widgets.Handle_Hidden (Inherited)
Widgets.Handle_Key_Held (Inherited)
Widgets.Handle_Key_Press (Inherited)
Widgets.Handle_Key_Release (Inherited)
Widgets.Handle_Mouse_Held (Inherited)
Widgets.Handle_Mouse_Move (Inherited)
Widgets.Handle_Mouse_Press (Inherited)
Widgets.Handle_Mouse_Release (Inherited)
Widgets.Handle_Mouse_Scroll (Inherited)
Widgets.Handle_Unhidden (Inherited)
Widgets.Set_Color (Inherited)
Widgets.Set_Dirty (Inherited)
Widgets.Set_Parent (Inherited)
Widgets.To_String (Inherited)
Widgets.Translate_To_Content (Inherited)
Widgets.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.