class Prism::GUIElement

Overview

Represents a single GUI element. GUIElements are 2d graphics drawn on the screen with a z-axis equal to 0.

Defined in:

prism/stdlib/gui_element.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(texture : Prism::Texture2D, position : Prism::Maths::Vector2f, scale : Prism::Maths::Vector2f) #

When setting the position remember that 0,0 is at the center of the screen. So the screen top left corner is -1, 1 while the bottom right corner is 1, -1 The position represents the center of the GUI texture. The scale represents the size of the GUI texture relative to the screen.


[View source]

Instance Method Detail

def position : Prism::Maths::Vector2f #

[View source]

[View source]
def texture : Prism::Texture2D #

[View source]