Table of Contents

Class Scene

Namespace
Fantas
Assembly
Fantas.dll

Scene is where all nodes are displayed

public class Scene : Node
Inheritance
Scene
Inherited Members
Extension Methods

Constructors

Scene()

Create a scene The size of the scene will match the logical device dimension in points for instance on iPhone 8, scene size will be 375 x 667 On Desktop platforms the default initial window size will be 800 x 480 The origin will be on the bottom left

public Scene()

Scene(Scene)

Copy scene constructor

public Scene(Scene other)

Parameters

other Scene

Scene(SizeF)

Create a Scene with the given logical size The origin will be on the bottom left

public Scene(SizeF size)

Parameters

size SizeF

Properties

AnchorPoint

Scene origin in the viewport

public PointF AnchorPoint { get; set; }

Property Value

PointF

BackgroundColor

BackgroundColor of the scene

public Color BackgroundColor { get; set; }

Property Value

Color

Camera

public CameraNode Camera { get; set; }

Property Value

CameraNode

CurrentScene

Current scene running in the game

public static Scene CurrentScene { get; }

Property Value

Scene

PhysicsWorld

Get/Create PhysicsWorld

public PhysicsWorld PhysicsWorld { get; }

Property Value

PhysicsWorld

Size

Size of the scene (points)

public SizeF Size { get; set; }

Property Value

SizeF

Methods

ConvertPointFromWindow(Point)

Convert from Windows coordinates to Scene

public PointF ConvertPointFromWindow(Point windowPoint)

Parameters

windowPoint Point

Returns

PointF

Point in Scene coordinates

ConvertPointToWindow(PointF)

Convert from Scene coordinates to Window

public Point ConvertPointToWindow(PointF scenePoint)

Parameters

scenePoint PointF

Returns

Point

Return point in Window coordinates (logical)

Copy()

Copy this scene

protected override Node Copy()

Returns

Node

Finish()

Called when the scene is no longer being presented

public virtual void Finish()

FirstHitTest(PointF)

Return the first Node that have HitTest = true, that intersects the scene point

public Node FirstHitTest(PointF scenePoint)

Parameters

scenePoint PointF

Returns

Node

OnControllerButtonPressed(ControllerButtonEventArgs)

Called when the controller button is pressed

public virtual void OnControllerButtonPressed(ControllerButtonEventArgs args)

Parameters

args ControllerButtonEventArgs

OnControllerButtonReleased(ControllerButtonEventArgs)

Called when the controller button is released

public virtual void OnControllerButtonReleased(ControllerButtonEventArgs args)

Parameters

args ControllerButtonEventArgs

OnControllerConnected(ControllerChangedEventArgs)

Called when the controller is connected

public virtual void OnControllerConnected(ControllerChangedEventArgs args)

Parameters

args ControllerChangedEventArgs

OnControllerDisconnected(ControllerChangedEventArgs)

Called when the controller is disconnected

public virtual void OnControllerDisconnected(ControllerChangedEventArgs args)

Parameters

args ControllerChangedEventArgs

OnControllerLeftThumbstickChanged(ControllerThumbstickChangedEventArgs)

Called when the controller left thumbstick is position changed

public virtual void OnControllerLeftThumbstickChanged(ControllerThumbstickChangedEventArgs args)

Parameters

args ControllerThumbstickChangedEventArgs

OnControllerLeftTriggerChanged(ControllerTriggerChangedEventArgs)

Called when the controller left trigger is position changed

public virtual void OnControllerLeftTriggerChanged(ControllerTriggerChangedEventArgs args)

Parameters

args ControllerTriggerChangedEventArgs

OnControllerRightThumbstickChanged(ControllerThumbstickChangedEventArgs)

Called when the controller right thumbstick is position changed

public virtual void OnControllerRightThumbstickChanged(ControllerThumbstickChangedEventArgs args)

Parameters

args ControllerThumbstickChangedEventArgs

OnControllerRightTriggerChanged(ControllerTriggerChangedEventArgs)

Called when the controller right trigger is position changed

public virtual void OnControllerRightTriggerChanged(ControllerTriggerChangedEventArgs args)

Parameters

args ControllerTriggerChangedEventArgs

OnDoubleClick(MouseEventArgs)

Called when mouse button double-clicked

public virtual void OnDoubleClick(MouseEventArgs args)

Parameters

args MouseEventArgs

OnDoubleTap(TapEventArgs)

Called on double tap gesture

public virtual void OnDoubleTap(TapEventArgs args)

Parameters

args TapEventArgs

OnKeyDown(KeyEventArgs)

Called when keyboard key is pressed

public virtual void OnKeyDown(KeyEventArgs args)

Parameters

args KeyEventArgs

OnKeyUp(KeyEventArgs)

Called when keyboard key is released

public virtual void OnKeyUp(KeyEventArgs args)

Parameters

args KeyEventArgs

OnLongPress(TapEventArgs)

Called on long press gesture

public virtual void OnLongPress(TapEventArgs args)

Parameters

args TapEventArgs

OnMouseDown(MouseEventArgs)

Called when mouse button is pressed

public virtual void OnMouseDown(MouseEventArgs args)

Parameters

args MouseEventArgs

OnMouseDrag(MouseEventArgs)

Called on mouse drag (click + move)

public virtual void OnMouseDrag(MouseEventArgs args)

Parameters

args MouseEventArgs

OnMouseMove(MouseEventArgs)

Called on mouse moved

public virtual void OnMouseMove(MouseEventArgs args)

Parameters

args MouseEventArgs

OnMouseUp(MouseEventArgs)

Called when mouse button is released

public virtual void OnMouseUp(MouseEventArgs args)

Parameters

args MouseEventArgs

OnMouseWheel(MouseEventArgs)

Mouse scroll wheel changed

public virtual void OnMouseWheel(MouseEventArgs args)

Parameters

args MouseEventArgs

OnPan(PanEventArgs)

Called on pan gesture

public virtual void OnPan(PanEventArgs args)

Parameters

args PanEventArgs

OnPanComplete(PanEventArgs)

Called on pan complete gesture

public virtual void OnPanComplete(PanEventArgs args)

Parameters

args PanEventArgs

OnPanStart(PanEventArgs)

Called on pan start gesture

public virtual void OnPanStart(PanEventArgs args)

Parameters

args PanEventArgs

OnPinch(PinchEventArgs)

Called on pinch gesture

public virtual void OnPinch(PinchEventArgs args)

Parameters

args PinchEventArgs

OnPinchComplete()

Called on pinch complete gesture

public virtual void OnPinchComplete()

OnPinchStart(PinchEventArgs)

Called on pinch start gesture

public virtual void OnPinchStart(PinchEventArgs args)

Parameters

args PinchEventArgs

OnSwipe(SwipeEventArgs)

Called on swipe gesture

public virtual void OnSwipe(SwipeEventArgs args)

Parameters

args SwipeEventArgs

OnTap(TapEventArgs)

Called on tap gesture

public virtual void OnTap(TapEventArgs args)

Parameters

args TapEventArgs

OnTouchDown(TouchEventArgs)

Called when screen touch begin

public virtual void OnTouchDown(TouchEventArgs args)

Parameters

args TouchEventArgs

OnTouchMove(TouchEventArgs)

Called when screen touch move

public virtual void OnTouchMove(TouchEventArgs args)

Parameters

args TouchEventArgs

OnTouchUp(TouchEventArgs)

Called when screen touch ends

public virtual void OnTouchUp(TouchEventArgs args)

Parameters

args TouchEventArgs

SizeChanged()

Called when scene size was changed

public virtual void SizeChanged()

Start()

Called when Scene scene is presented

public virtual void Start()

Update()

Called every time the scene needs to update the game logic 1/60 seconds

public virtual void Update()

Events

DoubleClick

Called when mouse button double-clicked

public event EventHandler<MouseEventArgs> DoubleClick

Event Type

EventHandler<MouseEventArgs>

DoubleTap

Called on double tap gesture

public event EventHandler<TapEventArgs> DoubleTap

Event Type

EventHandler<TapEventArgs>

KeyDown

Called when keyboard key is pressed

public event EventHandler<KeyEventArgs> KeyDown

Event Type

EventHandler<KeyEventArgs>

KeyUp

Called when keyboard key is released

public event EventHandler<KeyEventArgs> KeyUp

Event Type

EventHandler<KeyEventArgs>

LongPress

Called on long press gesture

public event EventHandler<TapEventArgs> LongPress

Event Type

EventHandler<TapEventArgs>

MouseDown

Called when mouse button is pressed

public event EventHandler<MouseEventArgs> MouseDown

Event Type

EventHandler<MouseEventArgs>

MouseDrag

Called on mouse drag (click + move)

public event EventHandler<MouseEventArgs> MouseDrag

Event Type

EventHandler<MouseEventArgs>

MouseMove

Called on mouse move

public event EventHandler<MouseEventArgs> MouseMove

Event Type

EventHandler<MouseEventArgs>

MouseUp

Called when mouse button is released

public event EventHandler<MouseEventArgs> MouseUp

Event Type

EventHandler<MouseEventArgs>

MouseWheel

Mouse scroll wheel changed

public event EventHandler<MouseEventArgs> MouseWheel

Event Type

EventHandler<MouseEventArgs>

Pan

Called on Pan gesture

public event EventHandler<PanEventArgs> Pan

Event Type

EventHandler<PanEventArgs>

PanComplete

Called on Pan complete gesture

public event EventHandler<PanEventArgs> PanComplete

Event Type

EventHandler<PanEventArgs>

PanStart

Called on Pan start gesture

public event EventHandler<PanEventArgs> PanStart

Event Type

EventHandler<PanEventArgs>

Pinch

Called on pinch gesture

public event EventHandler<PinchEventArgs> Pinch

Event Type

EventHandler<PinchEventArgs>

PinchComplete

Called on pinch complete gesture

public event EventHandler PinchComplete

Event Type

EventHandler

PinchStart

Called on pinch start gesture

public event EventHandler<PinchEventArgs> PinchStart

Event Type

EventHandler<PinchEventArgs>

Swipe

Called on swipe gesture

public event EventHandler<SwipeEventArgs> Swipe

Event Type

EventHandler<SwipeEventArgs>

Tap

Called on tap gesture

public event EventHandler<TapEventArgs> Tap

Event Type

EventHandler<TapEventArgs>

TouchDown

Called when screen touch begin

public event EventHandler<TouchEventArgs> TouchDown

Event Type

EventHandler<TouchEventArgs>

TouchMove

Called when screen touch move

public event EventHandler<TouchEventArgs> TouchMove

Event Type

EventHandler<TouchEventArgs>

TouchUp

Called when screen touch ends

public event EventHandler<TouchEventArgs> TouchUp

Event Type

EventHandler<TouchEventArgs>