marc.jamero.ph Posted April 3, 2012 Posted April 3, 2012 I'd like to create new sets of widget(i.e. WidgetInventory) via a plugin. Is it possible? If yes, how exactly can it be done? To make things clear, an Inventory Widget consists of let's say, 3 buttons, 1 listbox and a sprite. WidgetButton WidgetListBox WidgetSprite There, I need those Widgets to use inside the DLL Project using C++ via the C++ API and produce a plugin. In other words, I want to make a new WidgetInventory by using the default Widgets like WidgetButton in the form of a plugin.
unclebob Posted April 3, 2012 Posted April 3, 2012 Hi, You can't inherit from classes like Nodes, Widgets, etc. on C++ side. But you can extend them from UnigineScript. Please read this topics for additional information: 1) https://developer.unigine.com/forum/topic/1228-user-object-node-type 2) https://developer.unigine.com/forum/topic/1238-set-worldtrigger-callbacks-within-user-class-instance
marc.jamero.ph Posted April 10, 2012 Author Posted April 10, 2012 I have linked my C++ project to the C++ API and to the Unigine source. but I think Widgets are not exported out on the .dll right? that's why I can't make a plugin that will add Widgets like for example WidgetInventory.
marc.jamero.ph Posted April 10, 2012 Author Posted April 10, 2012 Is there any other way to access the core classes(widgets,nodes) using C++ aside from modifying the source of the Unigine?
unclebob Posted April 11, 2012 Posted April 11, 2012 No, you can't inherit without modifying the source. You can extend widgets/nodes/etc. in four different ways: 1. (C++ side, unlikely) Modify engine source and inherit you classes from original Widget/Node 2. (Unigine script) Inherit from extern 'Widget' class provided by C++ part 3. (Unigine script) Write custom wrapper class on one of currently available widgets (for example, buttons in Oil Rush is a custom wrapper on WidgetSprite class) 4. (Unigine script) Inherit from core/systems/widgets Widget class
Recommended Posts