Thread Tools Display Modes
07-20-06, 11:54 AM   #1
xardox
A Kobold Labourer
Join Date: Jul 2006
Posts: 1
Question Onclick to change the button texture

I have a mod im working on. Its fairly simple mod. But im new to LUA (not coding, i know perl, C, assembly lol) ...

The mod is a simple map, with buttons in predetermined locations on the map. Much like Gatherer. This map covers Ossirians room. This is in an instance so tracking location is impossible so it cannot act exactly like gatherer, much of it must be manual.

But this being said. the buttons are where the crystals spawn. The buttons start as a black version of the mini-map party icons. When click "the scout" clicks on them I want them to turn blue.

the "clicker" then clicks the blue icons to change them back to black. after a crystal has been activated.

This put all the communication for crystal scouting into a simple frame, connected by a channel. No more yelling into vent "THIS ONE IS CLOSE, NO THAT ONE, NO NO DAMMIT WIPE"

Im calling it "Ossirian Crystal Tracker 0.2" or OCT-0.2 (second revision since i got it to actually do something)


... Now you know WHAT im doing. Now ill list where ive gotten stuck so far.

I have the map texture working, ive placed the buttons in the spots i want them at, ive set the texture of each button to a black tinted party icon. I have a nice blue image to switch to, ready in the mod's folder.

I am wondering does anyone have a good snippit of code that shows how to change the texture of a button using the OnClick method?


Im thinking something like Button1_OnClick() { IF button1_Texture = "Blah.bmp" then :settexture "Blah2.bmp" else :settexture "Blah.bmp";}
(yea i know thats some fiercly ugly code)

just a simple image toggle.
Id have to do this for 12 different buttons, as there are 12 crystal spots on my map.


Also is there a good spot online to host my files for free so people can see what ive done so far so i can get some critque, and suggestions on my code.
  Reply With Quote
07-20-06, 12:15 PM   #2
JoshBorke
A Chromatic Dragonspawn
 
JoshBorke's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 185
check out http://www.wowwiki.com/API_Texture_GetTexture
  Reply With Quote
07-20-06, 12:28 PM   #3
brotherhobbes
A Rage Talon Dragon Guard
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 313
http://pastebin.com/

or you can just attach them here to your message
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Onclick to change the button texture


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off