Ran into a little gotcha today, the title says it all - The "area" property of text in a screen won't respect the width and height provided unless the numbers are integers.
Does not work ( text will not wrap ):
text "Test" area (0, 0, 100.0, 100.0)
Does work ( text wraps ):
text "Test" area (0, 0, int(100.0), int(100.0))
Might be a nice to have fix by casting the width/height into ints by default in the text display code.
- Miko-Class Veteran
- Posts: 509
- Joined: Sun Jun 05, 2016 8:29 pm
- Completed: The Falconers: Moonlight
- Organization: Bionic Penguin
- itch: bionicpenguin
Is there a reason why width and height has to be in float? There is no such thing as half a pixel in image resolution.
- Miko-Class Veteran
- Posts: 737
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
Ren'Py doesn't use subpixels?Divona wrote:There is no such thing as half a pixel in image resolution.
Dividing a number by a number is not programmatical, is fixed math. You already knows all the values.
So, wanna divide the screen 3 part? Grid or hbox.
Wanna divide 1280 by 7? You end with floats. A no no in pixel.
@Imperf3kt: subpixeling is a way of rendering objects taking into account the difference into real size and screen resolution. It doesn't allow you to move something by "half pixel". It move by one, then the blit area get calculated in relation to the item size and screen resolution ("blurring" or averaging the edges of the item and faking your eyes)
20 GOTO 10
- Ren'Py Creator
- Posts: 14705
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
Part of that was we didn't support subpixels back then. We actually do support subpixel now - Ren'Py is happy to put things on a pixel boundary. You have to cast to a special type called absolute, but pos (absolute(100.5), absolute(100.5)) will work fine.
(When was the last time you backed up your game?)
Code > Drama
Users browsing this forum: Bing [Bot]