Class Joyau::DrawableText
In: Drawable.cpp
Parent: Joyau::Shape

Class used when drawing text, using either a built-in or an OFT font.

Methods

Public Instance methods

Returns the text’s background.

[Source]

/*
  Returns the text's background.
*/
VALUE DrawableText_background(VALUE self)
{
   DrawableText &ref = getRef<DrawableText>(self);
   return col2hash(ref.getBackground());
}
background=(p1)

Alias for setBackground

Returns the text’s font name.

[Source]

/*
  Returns the text's font name.
*/
VALUE DrawableText_font(VALUE self)
{
   DrawableText &ref = getRef<DrawableText>(self);
   return rb_str_new2(ref.getFont().c_str());
}
font=(p1)

Alias for setFont

Returns the scripted state.

[Source]

/*
  Returns the scripted state.
*/
VALUE DrawableText_scripted(VALUE self)
{
   DrawableText &ref = getRef<DrawableText>(self);
   return ref.isScripted() ? Qtrue : Qfalse;
}

Sets the text’s background.

[Source]

/*
  call-seq: setBackground(color)
            background=(color)

  Sets the text's background.
*/
VALUE DrawableText_setBackground(VALUE self, VALUE color)
{
   DrawableText &ref = getRef<DrawableText>(self);
   OSL_COLOR col = hash2col(color);

   ref.setBackground(col);
   return color;
}

Loads an OFT. “” can be given to remove the actual font.

[Source]

/*
  call-seq: setFont(font)
            font=(font)

  Loads an OFT. "" can be given to remove the actual font. 
*/
VALUE DrawableText_setFont(VALUE self, VALUE font)
{
   DrawableText &ref = getRef<DrawableText>(self);
   std::string str = StringValuePtr(font);

   ref.setFont(str);
   return font;
}

Sets a drawable’s text.

[Source]

/*
  call-seq: setText(str)
            text=(str)

  Sets a drawable's text.
*/
VALUE DrawableText_setText(VALUE self, VALUE text)
{
   DrawableText &ref = getRef<DrawableText>(self);
   std::string txt = StringValuePtr(text);

   ref.setText(txt);
   return text;
}

Returns the stirring state.

[Source]

/*
  Returns the stirring state.
*/
VALUE DrawableText_stirring(VALUE self)
{
   DrawableText &ref = getRef<DrawableText>(self);
   return ref.isStirring() ? Qtrue : Qfalse;
}

Sets the stirring state.

[Source]

/*
  call-seq: setStirring(val)
            stirring=(val)
  
  Sets the stirring state.
*/
VALUE DrawableText_setStirring(VALUE self, VALUE val)
{
   DrawableText &ref = getRef<DrawableText>(self);
   ref.setStirring(val == Qtrue);

   return val;
}

Returns the text’s text.

[Source]

/*
  Returns the text's text.
*/
VALUE DrawableText_text(VALUE self)
{
   DrawableText &ref = getRef<DrawableText>(self);
   return rb_str_new2(ref.getText().c_str());
}
text=(p1)

Alias for setText

Toggle the scripted mode. When set to true, characters like n can be used.

[Source]

/*
  Toggle the scripted mode. When set to true, characters like \n can be used.
*/
VALUE DrawableText_toggleScripted(VALUE self)
{
   DrawableText &ref = getRef<DrawableText>(self);
   ref.toggleScripted();
   return Qnil;
}

Toggle the stirring mode.

[Source]

/*
  Toggle the stirring mode.
*/
VALUE DrawableText_toggleStirring(VALUE self)
{
   DrawableText &ref = getRef<DrawableText>(self);
   ref.toggleStirring();
   return Qnil;
}

[Validate]