class

GSDL::UI::Viewport

Inherits GSDL::UI::Canvas < GSDL::UI::Container < GSDL::UI::Element < Reference < Object

Constructors

new(width : Int32 = FillParent, height : Int32 = FillParent, x : Int32 = 0, y : Int32 = 0, anchor : Anchor = Anchor::Center, background_color : Color = Color::Transparent, padding = 0, margin = 0, flex : UInt8 = 1_u8)
Source
new(*args, **kwargs)
Source
new(*args, **kwargs, &)
Source

Instance methods

draw(draw : Draw)
Source
max_zoom
Source
max_zoom=(max_zoom : Float32)
Source
min_zoom
Source
min_zoom=(min_zoom : Float32)
Source
pan_x
Source
pan_x=(pan_x : Float32)
Source
pan_y
Source
pan_y=(pan_y : Float32)
Source
zoom
Source
zoom=(val : Float32)
Source
zoom_to(new_zoom : Float32, screen_cx : Num | Nil = nil, screen_cy : Num | Nil = nil)

Helper to zoom centering on a specific screen coordinate. If coordinate is nil, defaults to the center of the viewport on screen.

Source