class GSF::Message

Direct Known Subclasses

Defined in:

gsf/message.cr

Constant Summary

AnimateArrowDuration = 500.milliseconds
AnimateDuration = 300.milliseconds
ArrowBackgroundColor = SF::Color.new(17, 17, 17)
ArrowRadius = 16
BackgroundColor = SF::Color.new(17, 17, 17, 170)
FontSize = 16
LineSpacing = 16
MaxLines = 4
OutlineColor = SF::Color.new(102, 102, 102)
OutlineThickness = 4
Padding = 24
TextColor = SF::Color::White
TypeDuration = 69.milliseconds

Constructors

Instance Method Summary

Constructor Detail

def self.new(cx : Float32 | Int32, y : Float32 | Int32 = -1, bot_y = -1, width : Float32 | Int32 = Screen.width, message = "", typing : Bool = false, animate : Bool = false, choices : Array(NamedTuple(key: String, label: String)) = [] of ChoiceData) #

[View source]

Instance Method Detail

def animate? : Bool #

[View source]
def animate_arrow_duration #

[View source]
def animate_duration #

[View source]
def animated? #

[View source]
def arrow_background_color #

[View source]
def arrow_radius #

[View source]
def background_color #

[View source]
def choice_index : Int32 #

[View source]
def choice_padding #

[View source]
def choice_selected : ChoiceData | Nil #

[View source]
def choice_text : SF::Text #

[View source]
def choices : Array(ChoiceData) #

[View source]
def draw(window : SF::RenderWindow) #

[View source]
def draw_arrow(window) #

[View source]
def draw_border(window) #

[View source]
def draw_choice_border(window, px, py, text_width, selected) #

[View source]
def draw_choices(window) #

[View source]
def draw_text(window) #

[View source]
def font #

NOTE this has to be overridden by a custom font


[View source]
def font_size #

[View source]
def get_lines(all_text : Array(SF::Text)) : Array(Array(SF::Text)) #

[View source]
def get_pages #

[View source]
def height #

[View source]
def hide? : Bool #

[View source]
def hide_reset #

[View source]
def line_height : Float32 | Int32 #

[View source]
def line_spacing #

[View source]
def max_lines #

[View source]
def next_choice_joysticks?(joysticks : Joysticks) #

[View source]
def next_choice_keys #

[View source]
def next_choice_sound_buffer : SF::SoundBuffer | Nil #

NOTE this has to be overridden by a custom SF::SoundBuffer like @@next_choice_sound_buffer ||= SF::SoundBuffer.from_file("./assets/next_choice.wav")


[View source]
def next_choice_sound_pitch #

[View source]
def next_page_joystick_buttons #

[View source]
def next_page_keys #

[View source]
def next_page_or_hide #

[View source]
def next_page_sound_buffer : SF::SoundBuffer | Nil #

NOTE this has to be overridden by a custom SF::SoundBuffer like @@next_page_sound_buffer ||= SF::SoundBuffer.from_file("./assets/next_page.wav")


[View source]
def next_page_sound_pitch #

[View source]
def outline_color #

[View source]
def outline_thickness #

[View source]
def padding #

[View source]
def page_index : Int32 #

[View source]
def pages : Array(Array(Array(SF::Text))) #

[View source]
def play_sound(sound_buffer, pitch) #

[View source]
def previous_choice_joysticks?(joysticks : Joysticks) #

[View source]
def previous_choice_keys #

[View source]
def previous_choice_sound_buffer : SF::SoundBuffer | Nil #

NOTE this has to be overridden by a custom SF::SoundBuffer like @@previous_choice_sound_buffer ||= SF::SoundBuffer.from_file("./assets/previous_choice.wav")


[View source]
def previous_choice_sound_pitch #

[View source]
def reset_choice_selected #

[View source]
def reset_message #

[View source]
def show #

[View source]
def show? : Bool #

[View source]
def skip_typing_joystick_buttons #

[View source]
def skip_typing_keys #

[View source]
def skip_typing_sound_buffer : SF::SoundBuffer | Nil #

NOTE this has to be overridden by a custom SF::SoundBuffer like @@skip_typing_sound_buffer ||= SF::SoundBuffer.from_file("./assets/skip_page.wav")


[View source]
def skip_typing_sound_pitch #

[View source]
def sound : SF::Sound #

[View source]
def text : StyledText #

[View source]
def text_color #

[View source]
def type_duration #

[View source]
def typed? #

[View source]
def typed_message #

[View source]
def typing? : Bool #

[View source]
def update(keys : Keys, joysticks : Joysticks) #

[View source]
def update_data(message : String, choices : Array(NamedTuple(key: String, label: String)) = [] of ChoiceData) #

[View source]
def width #

[View source]
def x #

[View source]
def y #

[View source]