Create overlay from core images.

The place to post your WML questions and answers.

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.
Post Reply
User avatar
Xara
Posts: 270
Joined: December 26th, 2014, 12:23 am
Location: Beijing

Create overlay from core images.

Post by Xara »

I guess it's possible to create overlays from existing core images. For example, you can take the items/potion-red.png, shrink it and put it at the corner.

I'm not sure if anyone has done similar things through image path functions WML. Is there any codes that I can borrow?
It pronounces Sha'ha, not Zara.

Feedback Thread of my Add-ons
User avatar
Kwandulin
Art Contributor
Posts: 362
Joined: March 30th, 2014, 7:35 am
Location: Germany

Re: Create overlay from core images.

Post by Kwandulin »

I am doing exactly that in OoA. If you pick up an item (say, a sword) the following macro takes the image, shrinks it and places it in the top right corner above the unit sprite:

Code: Select all

#define ABILITY_ICON_OVERLAY IMAGE
	[effect]
		apply_to=overlay
		add=misc/blank-hex.png~BLIT({IMAGE}~CROP(14,14,42,42)~SCALE(16,16),42,0)
	[/effect]
#enddef
You might change values as needed
User avatar
Xara
Posts: 270
Joined: December 26th, 2014, 12:23 am
Location: Beijing

Re: Create overlay from core images.

Post by Xara »

Thanks, it works nicely.
It pronounces Sha'ha, not Zara.

Feedback Thread of my Add-ons
Post Reply