Computer Science Canada Error with GUI.GetEventWidgetID when dealing with Canvas |
Author: | GrandAvalon [ Sat Jan 10, 2004 8:52 pm ] | ||
Post subject: | Error with GUI.GetEventWidgetID when dealing with Canvas | ||
I am trying to create a card game where you can click and drag a card (multiple full canvases) and move it around the screen. However, GUI.GetEventWidgetID doesn't seem to get along with the full canvas (Error: "Reference through nil pointer").... ![]() The following code was used to test GUI.GetEventWidgetID.
|
Author: | Dan [ Sat Jan 10, 2004 9:14 pm ] |
Post subject: | |
needs to be: import GUI in "%oot/lib/GUI" need cpas in the GUI, well at least it is that way on my comp |
Author: | GrandAvalon [ Sat Jan 10, 2004 9:23 pm ] |
Post subject: | |
That is not the problem. |
Author: | Andy [ Sat Jan 10, 2004 9:26 pm ] |
Post subject: | |
GUI can be very messy, i suggest making ur own... i remember last yr when i had a problem with the gui textbox, i was making a chatprogram, but whenever someone pressed a key with the gui textbox on the screen the program would crash... i emailed tom west and he told me to declare the textfield before the textbox... y dont u email him and ask about it? |
Author: | GrandAvalon [ Sat Jan 10, 2004 9:31 pm ] |
Post subject: | |
How long did it took him to reply? Becuase I got only around a week to finish this program (its part of my school project). So this can be classified as urgent |
Author: | Dan [ Sat Jan 10, 2004 9:48 pm ] | ||
Post subject: | |||
pfff, tom? he may never reply. sory, i did not read your question right, why do you need to use the get id thing? just have a diffrent procedure for every canves and do somting like this:
also this could be done esaser with out the GUI by making your cards in to jpg files loading them and then using the pic comands to move them. |
Author: | GrandAvalon [ Sat Jan 10, 2004 10:30 pm ] |
Post subject: | |
Each deck has 52 cards. I will be doomed if I create a different procedure for each card, not to mention I have though about allowing the user to choose number of decks they want to use... (in casinos they usually have more than 1 deck so people cannot keep track of cards) |
Author: | Tony [ Sat Jan 10, 2004 10:36 pm ] |
Post subject: | |
gotta use arrays ![]() |
Author: | Dan [ Sat Jan 10, 2004 10:39 pm ] |
Post subject: | |
also you could make the drawing in turing, use pic comans to truing it in to a pichutre then move it that way |
Author: | GrandAvalon [ Sun Jan 11, 2004 3:31 pm ] |
Post subject: | |
tony wrote: gotta use arrays
![]() but when you CLICK on the card, that single procedure woouldn't know who called it unless I have the GUI.GetEventWidgetID crashed-proof. Of cause I can go through all the IDs on the array and check the X,Y coordinates and the bounds, but that will be both slow, ugly, and annoying |
Author: | Dan [ Sun Jan 11, 2004 11:39 pm ] |
Post subject: | |
i still dont get why you HAVE to uses GUI.GetEventWidgetID? in the code i posted you just need a difrent procedure for each canvas... |