Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: transperancy  (Read 6809 times)

0 Members and 1 Guest are viewing this topic.

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
transperancy
« on: July 17, 2003, 10:07:40 AM »

This might already exist, but I would like a method/function to Set the Transperancy of an entity/sprite with values from 0 to 100 (like in photoshop). Something like

SpriteExample.SetTransperancy(70);
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:transperancy
« Reply #1 on: July 17, 2003, 11:55:20 AM »

Actors and entites have an AlphaColor attribute. The AlphaColor attribute can define both color and transparency (0 to 255). I.e. to make an actor half transparent, you can do something like:

Code: [Select]
actor.AlphaColor = MakeRGBA(255, 255, 255, 128); // white color, alpha 128

Note that this setting overrides scene coloring. To reset the default behavior, set the AlphaColor attribute to zero.

Transparency for sprites can be defined in SpriteEdit.
« Last Edit: July 17, 2003, 11:55:50 AM by Mnemonic »
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re:transperancy
« Reply #2 on: July 17, 2003, 12:10:10 PM »

Actors and entites have an AlphaColor attribute. The AlphaColor attribute can define both color and transparency (0 to 255).

Thanks. I have used this attribute before, but I wasn't aware that it worked for transparency too (don't know why  ???).

Transparency for sprites can be defined in SpriteEdit.

Yes, I know this but it's not helpfull for what I want to do. I want to change a sprite's transparency with scripting because I have an image that want to appear and dissapear when I want to, with different speeds (so different Sleep() values).

EDIT: I just want to clarify what I want to do.
I would like to create a for() {...} loop in which I would change the transperancy of the sprite from 0 to 100 and from 100 to 0.
« Last Edit: July 18, 2003, 11:59:14 AM by odnorf »
Logged
fl*p

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re:transperancy
« Reply #3 on: July 20, 2003, 11:25:09 AM »

Sorry for posting again Jan, but it seems that you have lost my last post in this thread.
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:transperancy
« Reply #4 on: July 20, 2003, 12:09:24 PM »

Umm, I didn't, but I thought it was resolved. You can use an entity and change its transparency using the AlphaColor attribute, right?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re:transperancy
« Reply #5 on: July 20, 2003, 12:32:21 PM »

Umm, I didn't, but I thought it was resolved. You can use an entity and change its transparency using the AlphaColor attribute, right?

Oh... sorry... Yeah I know that I can use an entity instead, but for some reason I am trying not to create entities when they are not 100% needed (and Jerrot is using entities everywhere he can!, he can't stop it! :)). Anyway, it's not really important so I'll do it this way... :)
Logged
fl*p

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 690
    • View Profile
Re:transperancy
« Reply #6 on: July 20, 2003, 01:10:59 PM »

Oh... sorry... Yeah I know that I can use an entity instead, but for some reason I am trying not to create entities when they are not 100% needed (and Jerrot is using entities everywhere he can!, he can't stop it! :)). Anyway, it's not really important so I'll do it this way... :)

Yeah. Entities rock - and I see no reason why not to use them... ?!
Logged
Mooh!

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:transperancy
« Reply #7 on: July 20, 2003, 01:18:45 PM »

Yeah!

;)
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.101 seconds with 19 queries.