Difference between revisions of "World:setMeter"

m (Undo revision 4939 by Minicz (Talk))
Line 19: Line 19:
 
* [[parent::World]]
 
* [[parent::World]]
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=Set the scale of the world.
+
{{#set:Description=Set the scale of the world.}}
}}
+
{{#set:Since=000}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|World:setMeter}}
 
{{i18n|World:setMeter}}

Revision as of 17:53, 25 March 2011

Set the scale of the world.

The world scale is the number of pixels per meter. Try to keep your shape sizes less than 10 times this scale.

The default scale for new worlds is 30 pixels per meter.

This is important because the physics in Box2D is tuned to work well for objects of size 0.1m up to 10m. All physics coordinates are divided by this number for the physics calculations.

Function

Synopsis

World:setMeter( scale )

Arguments

number scale
The size of 1 meter in pixels.

Returns

Nothing.

See Also


Other Languages