Class: Raylib::Font

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/raylib/core/structs/font.rb

Overview

Font, font texture and GlyphInfo array data

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create(base_size, glyph_count, glyph_padding, texture, recs, glyphs) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/raylib/core/structs/font.rb', line 13

def self.create(base_size, glyph_count, glyph_padding, texture, recs, glyphs)
  new.tap do |instance|
    instance[:baseSize] = base_size
    instance[:glyphCount] = glyph_count
    instance[:glyphPadding] = glyph_padding
    instance[:texture] = texture
    instance[:recs] = recs
    instance[:glyphs] = glyphs
  end
end

Instance Method Details

#base_sizeInteger

Base size (default chars height)

Returns:

  • (Integer)

    baseSize



30
# File 'lib/raylib/core/structs/font.rb', line 30

def base_size = self[:baseSize]

#base_size=(new_base_size) ⇒ Object

Sets Base size (default chars height)



33
34
35
# File 'lib/raylib/core/structs/font.rb', line 33

def base_size=(new_base_size)
  self[:baseSize] = new_base_size
end

#glyph_countInteger

Number of glyph characters

Returns:

  • (Integer)

    glyphCount



39
# File 'lib/raylib/core/structs/font.rb', line 39

def glyph_count = self[:glyphCount]

#glyph_count=(new_glyph_count) ⇒ Object

Sets Number of glyph characters



42
43
44
# File 'lib/raylib/core/structs/font.rb', line 42

def glyph_count=(new_glyph_count)
  self[:glyphCount] = new_glyph_count
end

#glyph_paddingInteger

Padding around the glyph characters

Returns:

  • (Integer)

    glyphPadding



48
# File 'lib/raylib/core/structs/font.rb', line 48

def glyph_padding = self[:glyphPadding]

#glyph_padding=(new_glyph_padding) ⇒ Object

Sets Padding around the glyph characters



51
52
53
# File 'lib/raylib/core/structs/font.rb', line 51

def glyph_padding=(new_glyph_padding)
  self[:glyphPadding] = new_glyph_padding
end

#glyphsGlyphInfo *

Glyphs info data

Returns:



75
# File 'lib/raylib/core/structs/font.rb', line 75

def glyphs = self[:glyphs]

#glyphs=(new_glyphs) ⇒ Object

Sets Glyphs info data



78
79
80
# File 'lib/raylib/core/structs/font.rb', line 78

def glyphs=(new_glyphs)
  self[:glyphs] = new_glyphs
end

#recsRectangle *

Rectangles in texture for the glyphs

Returns:



66
# File 'lib/raylib/core/structs/font.rb', line 66

def recs = self[:recs]

#recs=(new_recs) ⇒ Object

Sets Rectangles in texture for the glyphs



69
70
71
# File 'lib/raylib/core/structs/font.rb', line 69

def recs=(new_recs)
  self[:recs] = new_recs
end

#textureTexture2D

Texture atlas containing the glyphs

Returns:



57
# File 'lib/raylib/core/structs/font.rb', line 57

def texture = self[:texture]

#texture=(new_texture) ⇒ Object

Sets Texture atlas containing the glyphs



60
61
62
# File 'lib/raylib/core/structs/font.rb', line 60

def texture=(new_texture)
  self[:texture] = new_texture
end

#to_sObject



24
25
26
# File 'lib/raylib/core/structs/font.rb', line 24

def to_s
  "Raylib::Font##{object_id} base_size=#{base_size} glyph_count=#{glyph_count} glyph_padding=#{glyph_padding} texture=#{texture} recs=#{recs} glyphs=#{glyphs}"
end