Namespace

SDL::TTF

Public Class Methods

GlyphMetrics( font, char ) click to toggle source

Returns

[minx, maxx, miny, maxy, advance], or nil on failure.

# File lib/ruby-sdl-ffi/ttf.rb, line 111
def self.GlyphMetrics( font, char )
  minx, maxx = FFI::Buffer.new(:int), FFI::Buffer.new(:int)
  miny, maxy = FFI::Buffer.new(:int), FFI::Buffer.new(:int)
  advance = FFI::Buffer.new(:int)
  result = __GlyphMetrics( font, char, minx, maxx, miny, maxy, advance )
  if( result == 0 )
    return [minx.get_int(0), maxx.get_int(0),
            miny.get_int(0), maxy.get_int(0), advance.get_int(0)]
  else
    nil
  end
end
SizeText( font, text ) click to toggle source
# File lib/ruby-sdl-ffi/ttf.rb, line 129
def self.SizeText( font, text )
  w = FFI::Buffer.new( :int )
  h = FFI::Buffer.new( :int )
  __SizeText( font, text, w, h )
  return [w.get_int(0),h.get_int(0)]
end
SizeUNICODE( font, text ) click to toggle source
# File lib/ruby-sdl-ffi/ttf.rb, line 153
def self.SizeUNICODE( font, text )
  w = FFI::Buffer.new( :int )
  h = FFI::Buffer.new( :int )
  __SizeUNICODE( font, text, w, h )
  return [w.get_int(0),h.get_int(0)]
end
SizeUTF( font, text ) click to toggle source
# File lib/ruby-sdl-ffi/ttf.rb, line 141
def self.SizeUTF( font, text )
  w = FFI::Buffer.new( :int )
  h = FFI::Buffer.new( :int )
  __SizeUTF( font, text, w, h )
  return [w.get_int(0),h.get_int(0)]
end
ttf_func( name, args, ret ) click to toggle source
# File lib/ruby-sdl-ffi/ttf.rb, line 42
def self.ttf_func( name, args, ret )
  func name, "TTF_#{name}", args, ret
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.