Filling a rectangle relative to X and Y. #2732
Replies: 3 comments
|
What are the textures that you're using? Is it only horizontal offsets that are an issue for you? Can you use rotated versions of the texture to compensate for the offset modulo 16 of the starting rectangle from the global origin? |
|
Unfortunately I lost 2 hours of work by not saving my changes on the way out. Essentially I was using that 9 tile idea to create "fancy" GUI elements such as buttons and borders and that kind of thing. You can slice up a small sample texture and stretch it to any dimension by repeating the stretched sides and middle. If I use rotated versions it'll probably put me back in the same boat when the buttons and box dimensions change once more. |
|
Sorry for the delay, I was off rebuilding Rome from first principles.
This is a time tested technique to allow "skinning" of GUIS with only a texture defined. Anyway you can load the demo and call The Non-Bug: Because texture fills all have the same origin, they don't start with offset origin where the blit rectangle would. (That'd make this work!) (be sure to slice off .txt extension - I had to fool GitHub) |

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I've been working for a couple of days on a standard 9 slice sprite drawing routine.
I'm very close to being done but I've been torpedoed by BLTSHADE.
I thought, "No problem, Medley can draw arbitrary length repeating textured rectangle for my stretched sides." but I didn't realise that it always fills texture from an absolute world origin rather than relative to the BLTSHADE rectangle being drawn.
It seems I've reached kind of an impasse without implementing BLTSHADE with a relative texture origin.
The red rectangle shows a stretched right side of a box but instead of aligning with the box's origin it uses an absolute texture coordinate system which misaligns it.
Now I guess the intermediate idea would be to make an intermediate image for the sides, blit to that then blit to the final destination. That's going to hammer the GC though because I'll be continually updating the rectangle dimensions.
So, I'm just looking for a way to continually draw a rectangle with repeating texture with the texture starting relative to that rectangle's origin.
All reactions