Logo


search API (or start typing anywhere)


Control

mint.Control

An empty control. Base class for all controls handles propogation of events, mouse handling, layout and so on


class
meta: @:directlyUsed, @:allow(mint.render.Renderer)


   

Members


canvas
canvas : mint.Canvas
Root canvas that this element belongs to
children
children : Array<mint.Control>
the list of children added to this control
closest_to_canvas
closest_to_canvas : mint.Control
the top most control below the canvas that holds us
iscaptured
iscaptured : Bool
if the control has modal focus
isfocused
isfocused : Bool
if the control has focus
ishovered
ishovered : Bool
if the control is under the mouse
ismarked
ismarked : Bool
if the control is marked for potential focus
key_input
key_input : Bool
if the control accepts key events
mouse_input
mouse_input : Bool
if the control accepts mouse events
name
name : String
The name of this control. default: ‘control’
onbounds
onbounds : mint.core.Signal<>
An event for when the bounds of the control change.
oncaptured
oncaptured : mint.core.Signal<>
An event for when this control is made or unmade the modal focus
onchildadd
onchildadd : mint.core.Signal<>
An event for when a child is added to the control.
onchildremove
onchildremove : mint.core.Signal<>
An event for when a child is removed from the control.
onclip
onclip : mint.core.Signal<>
An event for when the clipping rectangle changes for the control.
oncreate
oncreate : mint.core.Signal<>
An event for when the control is created. Used by the rendering service
ondepth
ondepth : mint.core.Signal<>
An event for when the control moves in depth in the canvas.
ondestroy
ondestroy : mint.core.Signal<>
An event for when the control is being destroyed.
onfocused
onfocused : mint.core.Signal<>
An event for when this control gains or loses focus
onkeydown
onkeydown : mint.core.Signal<mint.KeySignal>
An event for when a key is pressed and the control is focused (if key_input).
onkeyup
onkeyup : mint.core.Signal<mint.KeySignal>
An event for when a key is released and the control is focused (if key_input).
onmarked
onmarked : mint.core.Signal<>
An event for when this control is marked or unmarked for focus
onmousedown
onmousedown : mint.core.Signal<mint.MouseSignal>
An event for when the mouse is clicked on this control (if mouse_input).
onmouseenter
onmouseenter : mint.core.Signal<mint.MouseSignal>
An event for when the mouse enters the control (if mouse_input).
onmouseleave
onmouseleave : mint.core.Signal<mint.MouseSignal>
An event for when the mouse leaves the control (if mouse_input).
onmousemove
onmousemove : mint.core.Signal<mint.MouseSignal>
An event for when the mouse is moved inside this control (if mouse_input).
onmouseup
onmouseup : mint.core.Signal<mint.MouseSignal>
An event for when the mouse is released on this control (if mouse_input).
onmousewheel
onmousewheel : mint.core.Signal<mint.MouseSignal>
An event for when the mousewheel is moved while the mouse is inside this control (if mouse_input).
onrender
onrender : mint.core.Signal<>
An event for when (if) a control is marked as renderable and is rendered.
ontextinput
ontextinput : mint.core.Signal<mint.TextSignal>
An event for when a text/typing event happened and the control is focused (if key_input).
onvisible
onvisible : mint.core.Signal<>
An event for when the visibility of the control changes.
renderable
renderable : Bool
if the control emits a render signal
renderer
renderer : mint.render.Renderer

rendering
rendering : mint.render.Rendering
The rendering service that this instance uses, defaults to the canvas render service

Properties


bottom
bottom : Float
The bottom edge of the control bounds children_bounds
children_bounds : mint.ChildBounds
A getter for the bounds information about the children and their children in this control clip_with
clip_with : mint.Control
The control this one is clipped by depth
depth : Float
h
h : Float
The height of the control bounds h_max
h_max : Float
The maximum height h_min
h_min : Float
The minimum height nodes
nodes : Int
the number of controls below and including this one parent
parent : mint.Control
right
right : Float
The right edge of the control bounds visible
visible : Bool
If the control is visible w
w : Float
The width of the control bounds w_max
w_max : Float
The maximum width w_min
w_min : Float
The minimum width x
x : Float
The x position of the control bounds, world coordinate x_local
x_local : Float
The x position of the control bounds, relative to its container y
y : Float
The y position of the control bounds, world coordinate y_local
y_local : Float
The y position of the control bounds, relative to its container

Methods


add
add(child:mint.Control) : Void

captureinline

capture() : Void

contains

contains(_x:Float, _y:Float) : Bool

destroy

destroy() : Void

destroy_children

destroy_children() : Void

focusinline

focus() : Void

keydown

keydown(e:mint.types.KeyEvent) : Void

keyup

keyup(e:mint.types.KeyEvent) : Void

markinline

mark() : Void

mousedown

mousedown(e:mint.types.MouseEvent) : Void

mouseenter

mouseenter(e:mint.types.MouseEvent) : Void

mouseleave

mouseleave(e:mint.types.MouseEvent) : Void

mousemove

mousemove(e:mint.types.MouseEvent) : Void

mouseup

mouseup(e:mint.types.MouseEvent) : Void

mousewheel

mousewheel(e:mint.types.MouseEvent) : Void

new

new(_options:mint.ControlOptions, _emit_oncreate:Bool) : Void
Create a Control with the given options. The emit_oncreate flag will fire the oncreate signal at the end of this function default:false

remove

remove(child:mint.Control) : Void

render

render() : Void

set_pos

set_pos(_x:Float, _y:Float) : Void

set_size

set_size(_w:Float, _h:Float) : Void

textinput

textinput(e:mint.types.TextEvent) : Void

topmost_child_at_point

topmost_child_at_point(_x:Float, _y:Float) : mint.Control

uncaptureinline

uncapture() : Void

unfocus

unfocus() : Void

unmarkinline

unmark() : Void

update

update(dt:Float) : Void