[SOLVED] Icons/Images in the Middle of Messages/etc?

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
watbesh
Posts: 55
Joined: August 29th, 2012, 2:21 am
Location: Kanagawa, Japan

[SOLVED] Icons/Images in the Middle of Messages/etc?

Post by watbesh » July 18th, 2015, 3:16 pm

Hello.

I'm rewriting some codes of my eras to make them play better. Now I'm looking a way to use images more freely in the [message] or [option] tags.

As far as I know, {MENU_IMG_TXT (icon) (text)} allows to put one icon (usually a unit's sprite) at the beginning of the message (often inside [option] tag), and it would be shown as "[icon] text". I want to show multiple icons in one line, like "[icon1] [icon2] [icon3] text" or even "[icon1] text [icon2] [icon3]" if possible. Coding like {MENU_IMG_TXT (icon1) {MENU_IMG_TXT (icon2) (text)}} doesn't seem to work.

Is there any possible way to use images more freely?
What am I using this for?:
Last edited by watbesh on July 18th, 2015, 4:14 pm, edited 1 time in total.
My MP Eras and Mods with core units and unusual gameplay (version 1.3.1 for Wesnoth 1.12)

User avatar
Xara
Posts: 270
Joined: December 26th, 2014, 12:23 am
Location: Beijing

Re: Icons/Images in the Middle of Messages/etc?

Post by Xara » July 18th, 2015, 3:31 pm

I think you can use some codes in gtfgtf's "Pick Your Recruits, No Preparation Turn." Mod, it has a nice user interface.
It pronounces Sha'ha, not Zara.

Feedback Thread of my Add-ons

User avatar
watbesh
Posts: 55
Joined: August 29th, 2012, 2:21 am
Location: Kanagawa, Japan

Re: Icons/Images in the Middle of Messages/etc?

Post by watbesh » July 18th, 2015, 4:12 pm

Xara wrote:I think you can use some codes in gtfgtf's "Pick Your Recruits, No Preparation Turn." Mod, it has a nice user interface.
Ah, thanks. I found it, and achieving my goal is now possible at all. This looks hard to code, but I'll try.

(EDIT)
zookeeper wrote:You can also use ImagePathFunctionWML to combine multiple images into one (mostly with BLIT, and SCALE is helpful to set up the canvas).
Actually I was thinking Xara's solution is beyond my capability (I don't know a thing about Lua). I''ll use this instead. Thank you much!
Last edited by watbesh on July 19th, 2015, 1:13 am, edited 1 time in total.
My MP Eras and Mods with core units and unusual gameplay (version 1.3.1 for Wesnoth 1.12)

User avatar
zookeeper
WML Wizard
Posts: 9740
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: [SOLVED] Icons/Images in the Middle of Messages/etc?

Post by zookeeper » July 18th, 2015, 5:02 pm

You can also use ImagePathFunctionWML to combine multiple images into one (mostly with BLIT, and SCALE is helpful to set up the canvas).

Post Reply