GFX
  • Docs
  • API
Search Results for

    Show / Hide Table of Contents
    • Genesis.Core
      • AssetManager
      • Game
      • GameElement
      • GameEventHandler
      • GenesisWindow
      • IGameBehavior
      • Input
      • Layer
      • Light
      • Scene
      • Scene3D
      • SceneEventHandler
      • SceneSizeEvenHandler
      • Storage
      • Utils
    • Genesis.Core.Behaviors
      • AnimationBehavior
      • CameraFlags
      • CharacterController2D
      • ControllerPreset
      • MoveDirection
      • MovementFlags
      • SpriteMovementController
    • Genesis.Core.Behaviors.Physics2D
      • BufferedSpriteCollider
      • PhysicsBox2D
      • PhysicsPolygon2D
      • Rigidbody2D
    • Genesis.Core.Behaviors.Physics3D
      • BoxCollider
      • CapsuleCollider
      • ConvexHullBehavior
      • QubeConvexHull
      • SphereCollider
      • StaticMeshBehavior
    • Genesis.Core.Behaviors._3D
      • Stance
      • ThirdpersonCharacterController
    • Genesis.Core.GameElements
      • BufferedSprite
      • CameraElement
      • Element3D
      • Empty
      • Model
      • ParticleBuffers
      • ParticleDeffinition
      • ParticleEmitter
      • Qube
      • RectElement
      • Skybox
      • Sprite
      • SpriteShapeDeffinition
      • Terrain2D
      • Terrain3D
      • TerrainData
    • Genesis.Graphics
      • Animation
      • Camera
      • CameraType
      • Face
      • Font
      • Framebuffer
      • Glyphe
      • IRenderDevice
      • Material
      • MaterialBuffer
      • Mesh
      • PerspectiveCamera
      • Shader
      • ShaderProgram
      • TexCoords
      • Texture
      • Viewport
    • Genesis.Graphics.Animation3D
      • Animation
      • Animator
      • AssimpNodeData
      • Bone
      • KeyPosition
      • KeyRotation
      • KeyScale
      • ModelMesh
      • boneinfo
      • vertex
    • Genesis.Graphics.Physics
      • BulletDebugRenderer
    • Genesis.Graphics.RenderDevice
      • ClassicGL
      • GLRenderer
    • Genesis.Graphics.Shaders.OpenGL
      • AnimatedModelShader
      • BasicShader
      • DiffuseLightning
      • DiffuseNormalLightning
      • DiffuseNormalShader
      • DiffuseShader
      • DiffuseSolidShader
      • MVPRectShader
      • MVPShader
      • MVPSolidShader
      • ParticleShader
      • ScreenShader
      • SkyboxShader
      • SpriteShader
      • TerrainShader
      • WireframeShader
    • Genesis.Graphics.Shapes
      • BufferedSpriteShape
      • FrameShape
      • GlypheShape
      • LineShape
      • PlaneShape
      • QubeShape
      • RectShape
      • Shape
      • SpriteShape
    • Genesis.Math
      • Matrix4x4
      • NoisePoint
      • PerlinNoise
      • Rect
      • Vec3
    • Genesis.Physics
      • Aabb
      • HitResult
      • MatrixSet
      • MouseRay2
      • PhysicHandler
      • PhysicHandlerEvent
      • PhysicPropeterys
      • PhysicsBehavior
      • PhysicsBehaviorEvent
      • PhysicsHandler2D
      • PhysicsHandler3D
      • Raycast
    • Genesis.UI
      • Canvas
      • ImageButton
      • Label
      • ListItem
      • ListItemBehavior
      • ListSelector
      • ListSelectorBehavior
      • Panel
      • ProgressBar
      • UIEvent
      • UIParseHandler
      • UIParser
      • Widget

    Class Widget

    Base class for UI widgets.

    Inheritance
    object
    Widget
    ImageButton
    Label
    ListSelector
    Panel
    ProgressBar
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Genesis.UI
    Assembly: Genesis.dll
    Syntax
    public class Widget

    Constructors

    Widget()

    Creates a new instance of the Widget class.

    Declaration
    public Widget()

    Properties

    Children

    Gets or sets the list of child widgets.

    Declaration
    public List<Widget> Children { get; set; }
    Property Value
    Type Description
    List<Widget>

    Debug

    Gets or sets a value indicating whether debug mode is enabled for the widget.

    Declaration
    public bool Debug { get; set; }
    Property Value
    Type Description
    bool

    Enabled

    Gets or sets a value indicating whether the widget is enabled.

    Declaration
    public bool Enabled { get; set; }
    Property Value
    Type Description
    bool

    Location

    Gets or sets the location of the widget in 3D space.

    Declaration
    public Vec3 Location { get; set; }
    Property Value
    Type Description
    Vec3

    Name

    Gets or sets the name of the widget.

    Declaration
    public string Name { get; set; }
    Property Value
    Type Description
    string

    Parent

    Gets or sets the parent widget.

    Declaration
    public Widget Parent { get; set; }
    Property Value
    Type Description
    Widget

    Size

    Gets or sets the size of the widget.

    Declaration
    public Vec3 Size { get; set; }
    Property Value
    Type Description
    Vec3

    Methods

    AddChildren(Widget)

    Adds a child widget to the entity and sets the parent of the child entity.

    Declaration
    public void AddChildren(Widget widget)
    Parameters
    Type Name Description
    Widget widget

    The child widget to be added.

    FindChildren(string)

    Recursively finds a child widget with the given name.

    Declaration
    public Widget FindChildren(string name)
    Parameters
    Type Name Description
    string name

    The name to search for.

    Returns
    Type Description
    Widget

    The widget with the specified name, or null if not found.

    GetChildren(string)

    Returns the child widget with the specified name.

    Declaration
    public Widget GetChildren(string name)
    Parameters
    Type Name Description
    string name

    The name of the child widget to find.

    Returns
    Type Description
    Widget

    The child widget with the specified name, or null if not found.

    GetRelativeBounds2D(Canvas)

    Gets the relative bounds of the widget on the canvas.

    Declaration
    public Rect GetRelativeBounds2D(Canvas canvas)
    Parameters
    Type Name Description
    Canvas canvas

    The canvas used for rendering.

    Returns
    Type Description
    Rect

    The relative bounds of the widget.

    GetRelativePos(Canvas)

    Gets the relative position of the widget on the screen.

    Declaration
    public Vec3 GetRelativePos(Canvas canvas)
    Parameters
    Type Name Description
    Canvas canvas

    The canvas used for rendering.

    Returns
    Type Description
    Vec3

    The relative position of the widget.

    IsHover(Game, Scene, Canvas)

    Checks if the mouse is hovering over the widget.

    Declaration
    public bool IsHover(Game game, Scene scene, Canvas canvas)
    Parameters
    Type Name Description
    Game game

    The game instance.

    Scene scene

    The current scene.

    Canvas canvas

    The canvas used for rendering.

    Returns
    Type Description
    bool

    True if the mouse is hovering over the widget, otherwise false.

    OnDispose(Game, Scene, Canvas)

    Disposes the widget.

    Declaration
    public virtual void OnDispose(Game game, Scene scene, Canvas canvas)
    Parameters
    Type Name Description
    Game game

    The game instance.

    Scene scene

    The current scene.

    Canvas canvas

    The canvas used for rendering.

    OnInit(Game, Scene, Canvas)

    Initializes the widget.

    Declaration
    public virtual void OnInit(Game game, Scene scene, Canvas canvas)
    Parameters
    Type Name Description
    Game game

    The game instance.

    Scene scene

    The current scene.

    Canvas canvas

    The canvas used for rendering.

    OnRender(Game, IRenderDevice, Scene, Canvas)

    Renders the widget.

    Declaration
    public virtual void OnRender(Game game, IRenderDevice renderDevice, Scene scene, Canvas canvas)
    Parameters
    Type Name Description
    Game game

    The game instance.

    IRenderDevice renderDevice

    The render device used for rendering.

    Scene scene

    The current scene.

    Canvas canvas

    The canvas used for rendering.

    OnUpdate(Game, Scene, Canvas)

    Updates the widget.

    Declaration
    public virtual void OnUpdate(Game game, Scene scene, Canvas canvas)
    Parameters
    Type Name Description
    Game game

    The game instance.

    Scene scene

    The current scene.

    Canvas canvas

    The canvas used for rendering.

    Events

    Click

    Event triggered when the widget is clicked.

    Declaration
    public event UIEvent Click
    Event Type
    Type Description
    UIEvent

    MouseEnter

    Event triggered when the mouse enters the widget.

    Declaration
    public event UIEvent MouseEnter
    Event Type
    Type Description
    UIEvent

    MouseLeave

    Event triggered when the mouse leaves the widget.

    Declaration
    public event UIEvent MouseLeave
    Event Type
    Type Description
    UIEvent
    In this article
    Back to top Generated by DocFX