I'm working on a game that will have tiles with words on them. There are algorithms (plural) for the number and placement of the tiles. I have written a plugin that implements the first of the algorithms. It creates the objects and places them into the layout. Everything is good up to that point.
The challenge I have is that I don't see how to set the Text property of a Text object from my JavaScript code. Here is my code that creates the object:
function createObject( type, x, y ) {
var layer = runtime.running_layout.layers[type.default_layerindex];
var object = runtime.createInstance(type,layer);
object.x = x;
object.y = y;
return object;
}
[/code:1z76hlya]
The placement algorithm uses this function to put the text objects on the layout. Works like a charm. But the object does not have a Text property, so I cannot set the object text. In the debugger the object's constructor is shown as pluginProto.Instance and the text properties (Text, Font, Color, etc.) are not available.
So how do I modify the Text-specific object properties?
Also, is this kind of information in the documentation somewhere? I haven't been able to find a good reference for creating and manipulating objects from a plugin. Maybe I'm using the wrong search terms?