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
BackgroundColor
BackgroundColor of the scene
public Color BackgroundColor { get; set; }
Property Value
Camera
public CameraNode Camera { get; set; }
Property Value
CurrentScene
Current scene running in the game
public static Scene CurrentScene { get; }
Property Value
PhysicsWorld
Get/Create PhysicsWorld
public PhysicsWorld PhysicsWorld { get; }
Property Value
Size
Size of the scene (points)
public SizeF Size { get; set; }
Property Value
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
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
OnControllerButtonPressed(ControllerButtonEventArgs)
Called when the controller button is pressed
public virtual void OnControllerButtonPressed(ControllerButtonEventArgs args)
Parameters
OnControllerButtonReleased(ControllerButtonEventArgs)
Called when the controller button is released
public virtual void OnControllerButtonReleased(ControllerButtonEventArgs args)
Parameters
OnControllerConnected(ControllerChangedEventArgs)
Called when the controller is connected
public virtual void OnControllerConnected(ControllerChangedEventArgs args)
Parameters
OnControllerDisconnected(ControllerChangedEventArgs)
Called when the controller is disconnected
public virtual void OnControllerDisconnected(ControllerChangedEventArgs args)
Parameters
OnControllerLeftThumbstickChanged(ControllerThumbstickChangedEventArgs)
Called when the controller left thumbstick is position changed
public virtual void OnControllerLeftThumbstickChanged(ControllerThumbstickChangedEventArgs args)
Parameters
OnControllerLeftTriggerChanged(ControllerTriggerChangedEventArgs)
Called when the controller left trigger is position changed
public virtual void OnControllerLeftTriggerChanged(ControllerTriggerChangedEventArgs args)
Parameters
OnControllerRightThumbstickChanged(ControllerThumbstickChangedEventArgs)
Called when the controller right thumbstick is position changed
public virtual void OnControllerRightThumbstickChanged(ControllerThumbstickChangedEventArgs args)
Parameters
OnControllerRightTriggerChanged(ControllerTriggerChangedEventArgs)
Called when the controller right trigger is position changed
public virtual void OnControllerRightTriggerChanged(ControllerTriggerChangedEventArgs args)
Parameters
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
DoubleTap
Called on double tap gesture
public event EventHandler<TapEventArgs> DoubleTap
Event Type
KeyDown
Called when keyboard key is pressed
public event EventHandler<KeyEventArgs> KeyDown
Event Type
KeyUp
Called when keyboard key is released
public event EventHandler<KeyEventArgs> KeyUp
Event Type
LongPress
Called on long press gesture
public event EventHandler<TapEventArgs> LongPress
Event Type
MouseDown
Called when mouse button is pressed
public event EventHandler<MouseEventArgs> MouseDown
Event Type
MouseDrag
Called on mouse drag (click + move)
public event EventHandler<MouseEventArgs> MouseDrag
Event Type
MouseMove
Called on mouse move
public event EventHandler<MouseEventArgs> MouseMove
Event Type
MouseUp
Called when mouse button is released
public event EventHandler<MouseEventArgs> MouseUp
Event Type
MouseWheel
Mouse scroll wheel changed
public event EventHandler<MouseEventArgs> MouseWheel
Event Type
Pan
Called on Pan gesture
public event EventHandler<PanEventArgs> Pan
Event Type
PanComplete
Called on Pan complete gesture
public event EventHandler<PanEventArgs> PanComplete
Event Type
PanStart
Called on Pan start gesture
public event EventHandler<PanEventArgs> PanStart
Event Type
Pinch
Called on pinch gesture
public event EventHandler<PinchEventArgs> Pinch
Event Type
PinchComplete
Called on pinch complete gesture
public event EventHandler PinchComplete
Event Type
PinchStart
Called on pinch start gesture
public event EventHandler<PinchEventArgs> PinchStart
Event Type
Swipe
Called on swipe gesture
public event EventHandler<SwipeEventArgs> Swipe
Event Type
Tap
Called on tap gesture
public event EventHandler<TapEventArgs> Tap
Event Type
TouchDown
Called when screen touch begin
public event EventHandler<TouchEventArgs> TouchDown
Event Type
TouchMove
Called when screen touch move
public event EventHandler<TouchEventArgs> TouchMove
Event Type
TouchUp
Called when screen touch ends
public event EventHandler<TouchEventArgs> TouchUp