## basic questions

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
virtualfi
Prole
Posts: 3
Joined: Thu Feb 17, 2011 3:49 pm

### basic questions

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

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 (25.56 KiB) Viewed 1412 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???

bartbes
Sex machine
Posts: 4944
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

### Re: basic questions

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.

virtualfi
Prole
Posts: 3
Joined: Thu Feb 17, 2011 3:49 pm

### Re: basic questions

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

Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: basic questions

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.

virtualfi
Prole
Posts: 3
Joined: Thu Feb 17, 2011 3:49 pm

### Re: basic questions

this is it! thanks!

bartbes
Sex machine
Posts: 4944
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

### Re: basic questions

I keep calling it transform.. sorry, my bad.

Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: basic questions

bartbes wrote:I keep calling it transform
Yeah I know, I keep tripping up over that one myself.