InlineTextShape (object)

バージョン 2.4.0 で追加.

The InlineTextShape inherits from the InlineBaseTextShape object. It provides a shape type to draw text with TextGL.

/*
** Example: InlineTextShape :nooutput:
*/

// Get or create an InlineAtlasTexture texture (shared)
FilePath fontPath = FilePath("${FABRIC_DIR}/Resources/Fonts/Roboto/Roboto-Regular.ttf");
Ref<InlineDrawing> drawing = OGLInlineDrawing_GetInstance();
InlineAtlasTexture texture = drawing.getOrCreateAtlasTexture(fontPath, 20);

// Get the atlas owned by the texture
Ref<AtlasGL> atlas = texture.getAtlas(); 

// Create the shape
InlineTextShape shape = InlineTextShape('Text', atlas);

InlineTextShape InlineTextShape InlineTextShape InlineBaseTextShape InlineBaseTextShape InlineTextShape->InlineBaseTextShape InlineShapeBase InlineShapeBase InlineBaseTextShape->InlineShapeBase InlineEntityBase InlineEntityBase InlineShapeBase->InlineEntityBase InlineShape InlineShape InlineShapeBase->InlineShape InlineEntity InlineEntity InlineEntityBase->InlineEntity

Members

OGLText oglText  
InlineShapeAdaptor adaptor  

Methods

  InlineTextShape ( in InlineTextShape other )
  InlineTextShape ( in String name, in Ref<AtlasGL> atlas )
  InlineTextShape ()
InlineTextShape clone ? ()
  set2DText ! ( in Ref<AtlasGL> atlas, in String text, in Vec2 screenPosition, in Color color )
  set2DTextArray ! ( in Ref<AtlasGL> atlas, in String text[], in Vec2 screenPositions[], in Color color[] )
  set3DText ! ( in Ref<AtlasGL> atlas, in String text, in Vec3 worldPosition, in Color color )
  set3DTextArray ! ( in Ref<AtlasGL> atlas, in String text[], in Vec3 worldPositions[], in Color color[] )

Methods in detail

InlineTextShape ( in InlineTextShape other )

copy constructor


InlineTextShape ( in String name, in Ref<AtlasGL> atlas )

Constructs a InlineGeometryAttributeTextShape.

name The name of the InlineShape
atlas A reference to an AtlasGL


InlineTextShape ()

default constructor


InlineTextShape InlineTextShape.clone? ()

clone method


InlineTextShape.set2DText! ( in Ref<AtlasGL> atlas, in String text, in Vec2 screenPosition, in Color color )

Sets the text on screen space from a string.

atlas A reference to an AtlasGL
text Array of strings to display
screenPosition Positions, to place the text on the screen (-1, 1)
color Text color


InlineTextShape.set2DTextArray! ( in Ref<AtlasGL> atlas, in String text[], in Vec2 screenPositions[], in Color color[] )

Sets the text on screen space from an array of string.

atlas A reference to an AtlasGL
text Array of strings to display
screenPositions Positions, to place the text on the screen (-1, 1)
color Text color


InlineTextShape.set3DText! ( in Ref<AtlasGL> atlas, in String text, in Vec3 worldPosition, in Color color )

Sets the text in world space from a string.

atlas A reference to an AtlasGL
text Text to display
worldPosition Positions, to place the text on the world space
color Text color


InlineTextShape.set3DTextArray! ( in Ref<AtlasGL> atlas, in String text[], in Vec3 worldPositions[], in Color color[] )

Sets the text on world space from an array of string.

atlas A reference to an AtlasGL
text Array of strings to display
worldPositions Positions, to place the text in the world (-1, 1)
color Text color