Page 1 of 1

speech bubbles

Posted: Thu Feb 12, 2015 4:13 am
by pactace
hello all
I am making a 2d platformer, there is going to be a tutorial stage where it will teach the player how to control the game such as d = right a = left and space = jump I know the

Code: Select all

function love.draw()
                                                                                               love.setColor(red,green,blue)
                                                                                               love.graphics.rectangle("fill", cords, size)
                                                                                               love.setColor(red,green,blue)
                                                                                               love.graphics.print("text", cords, size)
                                                                                                                    
but how do I keep it in the corner of the players screen and destroy it after the charecter has clicked on it

Re: speech bubbles

Posted: Thu Feb 12, 2015 7:51 am
by s-ol
pactace wrote:hello all
I am making a 2d platformer, there is going to be a tutorial stage where it will teach the player how to control the game such as d = right a = left and space = jump I know the

Code: Select all

function love.draw()
                                                                                               love.setColor(red,green,blue)
                                                                                               love.graphics.rectangle("fill", cords, size)
                                                                                               love.setColor(red,green,blue)
                                                                                               love.graphics.print("text", cords, size)
                                                                                                                    
but how do I keep it in the corner of the players screen and destroy it after the charecter has clicked on it
Draw the text at 0,0 to put it in the top-left corner (don't have it transform with the camera). Then just check if there is something you want to show and if not then you don't draw it.

Re: speech bubbles

Posted: Fri Feb 13, 2015 12:47 am
by pactace
would it be easier instead of drawing it to just put an image there?
like

Code: Select all

function love.draw()
love.graphics.newImage( filename )

Re: speech bubbles

Posted: Fri Feb 13, 2015 1:01 am
by DaedalusYoung
That depends, but whatever you do, do not put love.graphics.newImage in your love.draw function.

Re: speech bubbles

Posted: Fri Feb 13, 2015 1:12 am
by Muris
By drawing it manually, you can create a lot more stylized bubble. The downside would be if you want to support multiple resolutions. The scaling of images might not look so good, or if you do not scale, it might become too small, if shown on somethong like mobile phone and the resolution is bigger. Yoiu could also design the stuff for large resolutions like 1920x1080, then scale down stuff to fit for you. Usually scaling down looks better in most cases than scaling up, or just completely ignore this all and use unscaled pixel perfect stuff.

Anyway if you want to know more about this stuff I guess there are tons of things in internet about resolution independency and resolution independent strategy on games.