
how do i calculate the gui-cooridnates from landscape coordinates and vice versa, or are those not connected in any way? how do i get the cursor gui-coordinates?

Point is: I don't know what exactly you are planning, but I can tell you that you won't have to "calculate the gui-cooridnates from landscape coordinates" for whatever you are doing. Not as someone who is using the ring menu, anyway, because you don't need to forward the mouse events to the ring menu, the clonk control library does that. The clonk control library gets the gui-mouse-position events and feeds them into the menu. Interesting for the content developer are only the callbacks to the control/menu objects.
Regarding the positions:
- A normal object that exists at position 100,100 is displayed at the position 100,100 relative to the landscape
- An object with category C4D_Foreground (or possibly C4D_GUI soon) that exists at position 100,100 is displayed at the position 100,100 relative to the screen.
It is not possible to convert gui coordinates into landscape coordinates and it is also not needed.
What exactly do you want to do?

>C4D_Foreground (or possibly C4D_GUI soon)
Don't you mean C4D_Paralax? =)


i tried different parameters. at first i tried:
menuitem=clonk->CreateRingMenu(Clonk,0,0,this);
(which is called by an object, which contains the clonk)
result: ringmenu in the top left corner
then:
menuitem=clonk->CreateRingMenu(Clonk,GetX(),GetY(),this);
result: ringmenu almost on the position i want it to, but only in fullscreen mode. in developer mode, its somehow shifted. but acceptable...
now to an object the clonk carries. on ControlUse(), it calls:
Contained()->CreateRingMenu(SpellCaster,x+GetX(),y+GetY(),this);
result: the ringmenu appears somewhere aound the clonk. i couldnt figure out a pattern yet.
additionally, after i opened the ringmenu and chose a point, i cant use that object anymore. i need to ctrl+click (does that have any function yet?) and after that, i can use the object once again.
ControlUse() returns true.
the whole ControlUse() script is here: (with debuglogs)
func ControlUse(object clonk, int x, int y)
{
Log("%d und %d",x,y);
Contained()->CreateRingMenu(SpellCaster,x+GetX(),y+GetY(),this);
for(var i=0; i<GetLength(spells); i++) Contained()->GetMenu()->AddItem(spells);
Contained()->GetMenu()->Show();
return true;
}

The interface of the ringmenu should look like CreateRingMenu(object menuobject, object controlobject) because the ringmenu should always be created at the cursor position but can also be created at any time in any script. Somehow, The ring menu needs a way to retrieve the cursors gui position right in place, the solution of a property of a button to send gui-coordinates/cursor coordinates does not suffice here.
So ATM it is really not possible to create a correct ring menu at the right position and to make it possible will require engine changes. Sven, what do you say to this, how can this be solved?
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill