README.mdown in ruby2d-camera-1.0.0 vs README.mdown in ruby2d-camera-1.1.0
- old
+ new
@@ -17,9 +17,14 @@
- `Camera.zoom` Default: 1. This is a multiplier for how much you want the camera to be zoomed in(e.g 2 is 2x zoom, 0.5 is 0.5x zoom)
- `Camera.x` and `Camera.y` Default: 0. This is the position the camera is centered on in the "world"
- `Camera.angle` Default: 0. This is the angle of how much the camera is rotated(in degrees). It ranges from 0-360. Giving values outside of this range will automagically convert them to fit within the 0-360 range.
+### There are also 2 helpful functions:
+
+- `Camera.coordinate_to_worldspace(x,y)` You pass coordinates on the screen(for example where a player clicked in the window) and it will return the coordinates(in a 2d array) what the coordinates are in the world
+- `Camera.coordinate_to_screenspace(x,y)` You pass in a coordinate in the world(for example an enemy in your game) and it will give you the coordinates(in a 2d array) of where on the screen this character appears. Note this function may return values that are outside of the screen if the object is not in view of the camera
+
## How it works:
A single `Camera` module exists which keeps track of objects created with it. When you create an object with the camera it creates a special object that inherits the original object from Ruby2D and then adds additional functions. The Camera module then uses these functions to draw the various objects on the screen each frame, using the parameters you gave it.
## Demo: