How do I do these cool things?

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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: How do I do these cool things?

Post by Robin »

bartbes wrote:That was my plan! I had some great ideas...
Too late. :joker:
Help us help you: attach a .love.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: How do I do these cool things?

Post by bartbes »

I will create a superior version!
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: How do I do these cool things?

Post by Robin »

bartbes wrote:I will create a superior version!
Try it!

:P
Help us help you: attach a .love.
Xoria
Citizen
Posts: 61
Joined: Sun Jan 31, 2010 1:24 am

Re: How do I do these cool things?

Post by Xoria »

lol my topic got hijacked. Umm, I didn't really catch how to change camera size, after declaring the table (camera = {} ) how do I change it with this? http://love2d.org/wiki/love.graphics.translate

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

Re: How do I do these cool things?

Post by Robin »

Xoria wrote:lol my topic got hijacked. Umm, I didn't really catch how to change camera size, after declaring the table (camera = {} ) how do I change it with this? http://love2d.org/wiki/love.graphics.translate
You mean scaling?

This is an example that makes everything twice as big, “zooming in” on the center:

Code: Select all

function love.draw()
    love.graphics.translate(-love.graphics.getWidth()/2, -love.graphics.getHeight()/2)
    love.graphics.scale(2, 2)
    love.graphics.translate(love.graphics.getWidth()/2, love.graphics.getHeight()/2)
    ... code here ...
end
It is very unoptimal, but it is just an example.
Help us help you: attach a .love.
Xoria
Citizen
Posts: 61
Joined: Sun Jan 31, 2010 1:24 am

Re: How do I do these cool things?

Post by Xoria »

Interesting, but how can one just make the camera alone change size?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: How do I do these cool things?

Post by Robin »

Xoria wrote:Interesting, but how can one just make the camera alone change size?
I do not understand your question. What do you want to do exactly? Perhaps it would help if you explained what the player should see.
Help us help you: attach a .love.
Xoria
Citizen
Posts: 61
Joined: Sun Jan 31, 2010 1:24 am

Re: How do I do these cool things?

Post by Xoria »

It's so basic, how can I change the scale of the camera?

If the camera gets big, what you see gets small, and vice versa. http://bryanheisey.com/blog/?p=1
User avatar
nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

Re: How do I do these cool things?

Post by nevon »

Xoria wrote:It's so basic, how can I change the scale of the camera?

If the camera gets big, what you see gets small, and vice versa. http://bryanheisey.com/blog/?p=1
That's exactly what they've been talking about. The "camera" is just an abstract idea of what is being displayed in the viewport. What you do when you zoom in is to simply make everything bigger, so that not everything fits in the viewport. Zooming out is making everything smaller, so that you can see more stuff in the viewport.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: How do I do these cool things?

Post by Robin »

nevon wrote:
Xoria wrote:It's so basic, how can I change the scale of the camera?

If the camera gets big, what you see gets small, and vice versa. http://bryanheisey.com/blog/?p=1
That's exactly what they've been talking about. The "camera" is just an abstract idea of what is being displayed in the viewport. What you do when you zoom in is to simply make everything bigger, so that not everything fits in the viewport. Zooming out is making everything smaller, so that you can see more stuff in the viewport.
To be more exact, it works like this:

Code: Select all

camerasize = screensize / scale
(not actual code :P)
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest