Missing .py files

Yes Locutus, I found that and made it a favorite. but the info there for the CyGInterfaceScreen does not list the arguments for its functions. I look forward to when the whole API is updated.
 
Trip said:
Uhhh... Hmmm...

Good luck. I haven't been able to find it myself. ;)

Some nice information I found is that the arguments list passed through the EventManager contains mx, my, px, py. (and a few others) I found that mx, my are Mouse X,Y and that px, py are Plot X,Y. Mouse X,Y is (drum roll) the location of your mouse. and Plot X,Y is the location of the selected Plot. Plot X,Y could be -1,-1 which means nothing is selected. (i need to verify that last statement)
 
Trip said:
It seems that weakciv has found a way around this problem though! What thread is that weakciv? That should probably be posted in a stickied thread in this forum... all I can see is the post, not the thread.
You can click the thread name at the top to see the full thread. The thread is a sticky, but the file is buried in the 24th page.

@Locutus: I linked to your API from the Modder's Guide, so at least somebody can find it here if they need to.

Good work, weakciv. :)
 
I've been doing some digging. I tried something but of course it didn't work, since I don't really know Python. But I think I'm on the right track.

In CvMainInterface you import CyInterface and create an instance of it(?). This class has the function (method?) getMousePos(), which returns POINT object. POINT has 2 attributes- int x and int y, which in this case will correspond to the location of the cursor. What I don't know is how to access those ints. If you create a CyInterface called screen_interface or whatever, then "mouse = screen_interface.getMousePos()" would create a POINT called mouse, right? But then what? mouse.x and mouse.y? POINT doesn't have any functions listed in the API, just those 2 ints.

FWIW, according to the online API, CyInterface will not be included in the SDK.
 
hmmm I havent messed with that part yet. Ill give it a try.
 
OK THANK YOU!!!!!!

Major step forward. CyInterface is imported when the
Code:
from CvPythonExtentions import *
statement is performed.

Looking at how CyInterface is used I found that this is how to get the x and y values:
Code:
# direct reference
CyInterface().getMousePos().x
# or assigned to a variable
Mx = CyInterface().getMousePos().x

Now I have a few bugs (like blinking and missing text) to address. But the text area now moves with the mouse.

Oh, I also have to put in logic to make sure the text area doesnt display off the screen too.
 
Back
Top Bottom