speech bubbles

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
User avatar
pactace
Prole
Posts: 38
Joined: Fri Jan 30, 2015 1:25 am

speech bubbles

Post 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
Very new programmer dont judge
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: speech bubbles

Post 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.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
User avatar
pactace
Prole
Posts: 38
Joined: Fri Jan 30, 2015 1:25 am

Re: speech bubbles

Post 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 )
Very new programmer dont judge
User avatar
DaedalusYoung
Party member
Posts: 407
Joined: Sun Jul 14, 2013 8:04 pm

Re: speech bubbles

Post by DaedalusYoung »

That depends, but whatever you do, do not put love.graphics.newImage in your love.draw function.
Muris
Party member
Posts: 131
Joined: Fri May 23, 2014 9:18 am

Re: speech bubbles

Post 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.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 72 guests