HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Getting a Handle's value (not it's reference)

01-04-2006, 04:25 AM#1
aaero
I'm having a problem that I don't really know how to search on. Here's a code snippet:

Collapse JASS:
local texttag a;

a = udg_tt[0]
call FadeTextTag(a) 
// FadeTextTag is an imaginary function that makes a texttag fade to nothing and sets permanent to false

The problem is that I want "a" to be a copy of the handle I assign it to - I don't want a reference/pointer (pick your term) to the original handle. I want to be able to fade out a copy of a texttag while the original texttag stays visible.

Is this possible? Am I being clear enough? Thanks for any help.
01-04-2006, 05:16 AM#2
AnarkiNet
would this work?
Collapse JASS:
function TextTagClone takes texttag whichTextTag returns texttag
return whichTextTag
endfunction
im not sure if that would get around the reference problem you are having. might be worth a try.
01-04-2006, 05:40 AM#3
Blade.dk
That would not help, as it would return the exact same object.

Try to store the x and y coordinates and other preferences you used when you created the first texttag on it, and then simply retrieve that info and create another texttag - a copy that you can destroy.
01-04-2006, 06:50 AM#4
aaero
I can get around it Blade (but thanks for suggestion) - I just hope I don't have to. This seems like it would be pretty useful.
01-04-2006, 07:10 AM#5
Blade.dk
I don't think it is possible at all to make it without recreating it.
01-04-2006, 10:22 AM#6
PitzerMike
There's no way to make a deep copy of an object in JASS. You have to recreate it.
01-04-2006, 03:31 PM#7
aaero
Alright - thanks anyway! I'll keep that in mind in the future as well.

Thanks for the help and the quick responses!