Merging 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
Glen
Posts: 77
Joined: August 20th, 2011, 10:59 pm

Merging Images

Post by Glen »

I am attempting to merge two unit images to display for a menu option like this:

Code: Select all

#define OPTION6 MESSAGE VARNAME VARSET FILTERIDSIDE FORSIDE BETTEDSIDE PLAYERSIDE IMAGE
[option]

message = {MENU_IMG_TXT "{IMAGE}" _"{MESSAGE}"}
[command]
[set_variable]
name = {VARNAME}
value = {VARSET}
[/set_variable]
[scroll_to_unit]
[filter]
side = {FILTERIDSIDE}
[/filter]
for_side= {FORSIDE}
[/scroll_to_unit]
{GOLD_OPTIONS {BETTEDSIDE} {PLAYERSIDE}}
[/command]
[/option]
#enddef
I am storing 2 units(a spearman and a bowman in this case) and using ~Blit on to merge their images

Code: Select all

#define UNITSTORE ID VARNAME
[store_unit]
[filter]
id= {ID}
[/filter]
variable = {VARNAME}
[/store_unit]
#enddef


{UNITSTORE Spearman-Round2 Spearman}
{UNITSTORE Bowman-Round2 Bowman}


[set_variable]
name = Spearman.image
value = $Spearman.image~BLIT($Bowman.image)
[/set_variable]

{OPTION6 (Spearman and Bowman) (Red_Choice_Round2) (Humans) (5) (1) (5) (Player1Side) $Spearman.image}

No errors but the end result is the Spearman image is unchanged and not merged with the bowman image. What am I doing wrong here?
User avatar
beetlenaut
Developer
Posts: 2825
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Merging Images

Post by beetlenaut »

You need to use ~BLIT() with a path to the other image file, not a WML variable.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Post Reply