John Labenski wrote:

Humm, I don't think I understand. I haven't looked at the code for
wxluacan yet however.
Let me try to explain what i want to do without going into detail.

First canvasobjects are placed on a canvas and the are drawn and hittested by a member function of that cavasobject. So for each derived canvasobject there is a different draw and hittest functions. This how there is a rectangle and circle object already. The idea is to implement a special canvasobject which has its draw and hittest function implemented as a lua function. This lua function can be edited runtime if wanted, and the functions (draw and hittest ) are stored in a string inside the canvasobject. So as soon as the object needs to be drawn on the canvas, it needs to call the function stored inside the script.
And as input parameter it will get the wxDC* that is used to draw.
The lua canvas object is created in C++ and stored in the canvas. Let's assume the default script string is drawing a rectangle. When drawing the canvas and arriving at this specific lua canvas object stored in that canvas, i already have the object pointer ( the c++ object), and only need to call a (draw/hittest) function, which is stored in its script string. For each luacanvasobject instance added to the canvas, the script string may have its own implementation. One draws a single rectangle, and another draws a whole set of whatever.

Easy to say, but i realize it is not so simple ;-)
Maybe i should begin with making all drawing and hittets functions unique.
Like:
MYOBJ_1_Draw( )
MYOBJ_1_Hittest( )
MYOBJ_2_Draw( )
MYOBJ_2_Hittest( )
etc.
That would reduce it to loading those function at the start, and call the right one from C++.

First read some more about calling lua functions,

Thanks,

Klaas









-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to