PDA

View Full Version : imgtag bitmap opacity


smileyPotato
08-19-2010, 12:01 AM
Hi,
I'm trying to create a custom UI for a black/white silhouetted character. I would like to have an "all black" base outfit as the main image, and be able to click on the shirt or pants to turn them white. Imgtag doesn't have a .visible property like bitmap, so I assume I need to use .opacity, however it seems to have no effect on either my base ui image or my shirt-only image. Even when I set opacity = 0 on both images, they still appear.

Has anyone had this issue before?

Edit: I realize this function switches between the 2 images right now instead of just turning on/off the shirt image, but either way opacity doesn't seem to work. I've also tried offsetting the 2 images to see if either one turns on or off, but with no luck.
rollout guy "Mini Guy" width:430 height:332
(
imgTag guy_ui pos:[10,10] bitmap:(openBitmap ("C:\guy_blank.bmp")) transparent:white
imgTag guy_shirt pos:[10,10] bitmap:(openBitmap ("C:\guy_shirt.bmp")) transparent:black

fn toggleItem item item2 =
(
if (item.opacity == 0) then
item.opacity = 1
else
item.opacity = 0

if (item2.opacity == 0) then
item2.opacity = 1
else
item2.opacity = 0
)

on guy open do
(
guy_ui.opacity = 0
)
on guy_ui mousedown do
(
toggleItem guy_ui guy_shirt
)
)
createDialog guy

thanks!

Insanto
08-19-2010, 04:54 AM
if the opacity val don't work its because your on an NT system, im afraid the bitmap UI Item is (appart from dotNet) your only choice for gradual overall opacity

uhm of course it has a .visible property (thats one of the shared ones) (boolean)

smileyPotato
08-19-2010, 04:28 PM
ah, thank you! I'm still new to scripting, and had gotten some errors when trying to use .visible. It wasn't listed in the documentation for imgtag properties so I thought it might not be available. I got what I needed using that with boolean, thanks!

CGTalk Moderation
08-19-2010, 04:28 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.