Help displaying a large background image in game

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
ancestral
Inactive Developer
Posts: 1108
Joined: August 1st, 2006, 5:29 am
Location: Motion City

Help displaying a large background image in game

Post by ancestral »

Pretty basic task, I’d just like to display a large custom .jpg image, as if it were like a background, over/in place of terrain.

I’ve tried [item], which works, but causes the image to disappear over hexes where the mouse is hovering, exposing the bare terrain, which is disappointing.

I’m now trying to create a large terrain overlay, which I think may work, but it needs to be a very large multi-hex — maybe 10 hexes by 6 hexes — and I can’t say that I’ve figured out yet how to crete a custom terrain to span that size.

Any thoughts? Is there a better or easier way to display a large image? I’m using Wesnoth 1.11.1.

Thanks!
Wesnoth BestiaryPREVIEW IT HERE )
Unit tree and stat browser
CanvasPREVIEW IT HERE )
Exp. map viewer
User avatar
Alarantalara
Art Contributor
Posts: 786
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: Help displaying a large background image in game

Post by Alarantalara »

To Lands Unknown has lots of examples.

If you want a single moderately simple example, look at the last terrain graphics tag in this file: http://wesnoth-umc-dev.svn.sourceforge. ... xt%2Fplain It's about 17x10 hexes.

It requires an overlay to be placed on the map, so there needs to be one moderately clear hex.
The important parts are the large terrain map to cover all the relevant hexes (so you need to do some pixel math to make sure it's big enough), and an image tag outside of all the tile tags.
Post Reply