class

SfmlBook::Chapter6::GUI::Button

Inherits SfmlBook::Chapter6::GUI::Component < SF::NonCopyable < SF::Drawable < SF::Transformable < Reference < Object

Constructors

new(fonts : FontHolder, textures : TextureHolder)
Source

Instance methods

activate
Source
callback=(callback : Proc(Nil) | Nil)
Source
callback?
Source
deactivate
Source
deselect
Source
draw(target : SF::RenderTarget, states : SF::RenderStates)

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
Source
handle_event(event : SF::Event)
Source
select
Source
selectable?
Source
text=(text : String)
Source
toggle=(toggle : Bool)
Source
toggle?
Source