basic questions

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
virtualfi
Prole
Posts: 3
Joined: Thu Feb 17, 2011 3:49 pm

basic questions

Post by virtualfi »

Hello all!

I'm new here. I just started to play around with the engine and I'm truly amazed - big thanks to the authors for making love2d!
First of all - STATEMENT-I'm not a programer. I rather consider myself an art person :) My last programing experience was a very simple 2d rpg game that I wrote 10 years ago in vicual c++. I hardly remember anything about programing except the basics of basics, so dont be suprised by the questions I'm going to ask :megagrin:

question:
1. I put every object that I draw into love.draw callback. It doesnt seem to be good idea since most of the objects don't have to be refresh very often, for example buttons (in example top part of window.
2. I load background image which is displayed as white color instead of actual image, can't figure out what is wrong since i load it and draw it exactly the same way as it is I do for sprites and they are displayed corecty. load img in love.load,draw in love.draw:

love.graphics.draw(img_back,0,0)
example.png
example.png (25.56 KiB) Viewed 4515 times
3. One of the game character is going to have earthquake spell. I'm going to visualize it by "shaking" the view. Is there quick and easy way to do it?

many thanks for help and once again - thumbs up for all love2d contributors :)
virtualfi

PS: why the hell everybody has "obey" word in their avatars???
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: basic questions

Post by bartbes »

virtualfi wrote: question:
1. I put every object that I draw into love.draw callback. It doesnt seem to be good idea since most of the objects don't have to be refresh very often, for example buttons (in example top part of window.
It's not that bad, but if you really want to optimize here you can try framebuffers.
virtualfi wrote: 2. I load background image which is displayed as white color instead of actual image, can't figure out what is wrong since i load it and draw it exactly the same way as it is I do for sprites and they are displayed corecty. load img in love.load,draw in love.draw:
PO2 Syndrome
virtualfi wrote: 3. One of the game character is going to have earthquake spell. I'm going to visualize it by "shaking" the view. Is there quick and easy way to do it?
In general love.graphics.transform love.graphics.translate + math.random can produce some nice shaking, try it, hopefully it's good enough.
virtualfi wrote: PS: why the hell everybody has "obey" word in their avatars???
You must be a victim of The Evil Plot.
User avatar
virtualfi
Prole
Posts: 3
Joined: Thu Feb 17, 2011 3:49 pm

Re: basic questions

Post by virtualfi »

wow, quick and promt reply - thanks!

PO2 syndrome... hehe, I've drawn buttons and strites in power of 2 size. Old habit from 16bit architecture :)

As fo love.graphics.transform - a cant find anything about that in wiki, could you please provide.
When i just call it without parameters it gives me error indicating that this method doesnt exist at all :)

As for "evil plot" - sexy idea :)
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: basic questions

Post by Robin »

virtualfi wrote:As fo love.graphics.transform - a cant find anything about that in wiki, could you please provide.
When i just call it without parameters it gives me error indicating that this method doesnt exist at all :)
It's actually love.graphics.translate. You can use it as such:

Code: Select all

love.graphics.translate(math.random(-5, 5),math.random(-5, 5)) -- the numbers determine the amount of shaking
I have used it in that way in the past, and it works beautifully.
Help us help you: attach a .love.
User avatar
virtualfi
Prole
Posts: 3
Joined: Thu Feb 17, 2011 3:49 pm

Re: basic questions

Post by virtualfi »

this is it! thanks!
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: basic questions

Post by bartbes »

I keep calling it transform.. sorry, my bad.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: basic questions

Post by Robin »

bartbes wrote:I keep calling it transform
Yeah I know, I keep tripping up over that one myself.
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Semrush [Bot] and 5 guests