Image doesn't fit on canvas (1.14)
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.
Image doesn't fit on canvas (1.14)
Hi,
On 1.14 I'm getting Image doesn't fit on canvas error.
The culprit is this bit:
Any ideas on how to fix that?
misc/bigmap1.png dimensions are 1024x768.
On 1.16 I'm not getting an error, but it doesn't seem to be placing the battle marker on the right place either. It's showing it in the top left corner.
On 1.14 I'm getting Image doesn't fit on canvas error.
Code: Select all
20220116 12:10:03 error general: An error due to possibly invalid WML occurred
The error message is :
Image doesn't fit on canvas.
When reporting the bug please include the following error message :
Condition 'as_int >= 0' failed at /mnt/SDB/src/wesnoth/build/wesnoth/src/gui/core/canvas.cpp:1041 in function 'dimension_validation'. Extra development information: Image 'misc/new-battle2.png', x = -15.
Code: Select all
[part]
[background_layer]
image=misc/bigmap1.png
[/background_layer]
show_title=yes
{NEW_BATTLE 835 400}
[/part]
misc/bigmap1.png dimensions are 1024x768.
On 1.16 I'm not getting an error, but it doesn't seem to be placing the battle marker on the right place either. It's showing it in the top left corner.
- beetlenaut
- Developer
- Posts: 2814
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Image doesn't fit on canvas (1.14)
Overlay images (like in NEW_BATTLE) are placed using the dimensions of the image set by the "background" key in [part], not by the image in the [background_layer] tag. (You can have it use the layer, but you would have to specify that.)
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: Image doesn't fit on canvas (1.14)
That explains why the overlay was displayed in the top left corner in 1.16.
So there are two solutions for it.
or
Thank you for your help!
So there are two solutions for it.
Code: Select all
[part]
[background_layer]
image=misc/bigmap1.png
base_layer=yes
[/background_layer]
show_title=yes
{NEW_BATTLE 835 400}
[/part]
Code: Select all
[part]
background=misc/bigmap1.png
show_title=yes
{NEW_BATTLE 835 400}
[/part]