class SfmlBook::Chapter6::GUI::Button

Defined in:

chapter6/gui/button.cr

Constructors

Instance Method Summary

Instance methods inherited from class SfmlBook::Chapter6::GUI::Component

activate activate, active? : Bool active?, deactivate deactivate, deselect deselect, draw(target : SF::RenderTarget, states : SF::RenderStates) draw, handle_event(event : SF::Event) handle_event, select select, selectable? selectable?, selected? : Bool selected?

Constructor Detail

def self.new(fonts : FontHolder, textures : TextureHolder) #

[View source]

Instance Method Detail

def activate #

[View source]
def callback=(callback : Proc(Nil) | Nil) #

[View source]
def callback? : Proc(Nil) | Nil #

[View source]
def deactivate #

[View source]
def deselect #

[View source]
def draw(target : SF::RenderTarget, states : SF::RenderStates) #
Description copied from module SF::Drawable

Draw the object to a render target.

This is an abstract method that has to be implemented by the including class to define how the drawable should be drawn.

  • target - Render target to draw to
  • states - Current render states

[View source]
def handle_event(event : SF::Event) #

[View source]
def select #

[View source]
def selectable? #

[View source]
def text=(text : String) #

[View source]
def toggle=(toggle : Bool) #

[View source]
def toggle? : Bool #

[View source]