replace color with transparent using ~PAL or similar?
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
replace color with transparent using ~PAL or similar?
Hi I'm trying to make a colour in an image/icon transparent, I can make the whole thing transparent with O~() but just want to replace a particular colour, which I can do for non-transparent colors with ~PAL() e.g. icons/jewelry_necklace_amber.png~PAL(0,0,0 > red)~O(0%)
The above replaces the black background of the icon with red, and applies a general opacity setting to the image, but does anyone know how to set the opacity of a particular colour?
gwledig
Moved to WML Workshop ― shadowm
The above replaces the black background of the icon with red, and applies a general opacity setting to the image, but does anyone know how to set the opacity of a particular colour?
gwledig
Moved to WML Workshop ― shadowm
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
Re: replace color with transparent using ~PAL or similar?
I don't think there's currently a way to do that with the existing ImagePathFunctions, sorry.
It might be a good feature request, though.
It might be a good feature request, though.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Re: replace color with transparent using ~PAL or similar?
Thanks anyway. I get a reasonable outcome by replacing the background colour with the background colour of the area where the unit will appear (a kind of grey chasm background) and applying a partial opacity to the whole thing, this makes the unit look faded but it looks more like a regular units now, I am thinking in particular of non core unit artwork which can be used as multiplayer distributable unit art, not the greatest outcome but kindof works, e.g. "image.png~PAL(0,0,0 > 34, 56, 34)~O(70%)" this replaces the background black colour with the rgb values specified and partial opacity for the whole icon.
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: replace color with transparent using ~PAL or similar?
Is there a reason you can't use an image editor to select and erase the color?
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: replace color with transparent using ~PAL or similar?
its for a multiplayer scenario and I'm working on the basis that a host can run a game & players can join without DL the scenario.
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)