Transforming an Image

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Biphe
Prole
Posts: 13
Joined: Sun Jun 17, 2012 1:38 am

Transforming an Image

Post by Biphe »

So I have a gui setup and it is not the width of my game window so I wanted to know using this image:
Image
Could I tranform the gui boxes using love to fit my 512 by 512 game window?
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Transforming an Image

Post by davisdude »

You would actually need to scale it to fit the window.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: Transforming an Image

Post by micha »

If you scale it, the line width will increase, too. And you cannot have arbitrary height/width rations.

What you need is a tile-approach. In the spritesheet you have tiles for the four corners and tiles for the upper, lower, left and right boundary. Put the corners into the window corners and put multiple copies of the boundaries to the window boundaries. You need Quads and SpriteBatches for that.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests