aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorxgoff <antipotroast@gmail.com>2012-08-03 13:26:16 -0500
committerxgoff <antipotroast@gmail.com>2012-08-03 13:26:16 -0500
commit4c9176ee3ab1f434d9bccb2955f852df105c1702 (patch)
treebbb600dff6d6eff24471fd19dce5e90691cb4a0b /README.md
parent0a822c648427155c2649665f5f083ee299644ab9 (diff)
downloadlove2d-fakecanvas-4c9176ee3ab1f434d9bccb2955f852df105c1702.tar.gz
love2d-fakecanvas-4c9176ee3ab1f434d9bccb2955f852df105c1702.tar.bz2
love2d-fakecanvas-4c9176ee3ab1f434d9bccb2955f852df105c1702.tar.xz
love2d-fakecanvas-4c9176ee3ab1f434d9bccb2955f852df105c1702.zip
add setOption and getOption functions.
to start off, there is an option "vflip", used for potential performance increase, at the cost of incorrect texture coordinates
Diffstat (limited to 'README.md')
-rw-r--r--README.md9
1 files changed, 7 insertions, 2 deletions
diff --git a/README.md b/README.md
index 87749b7..22f5e2c 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ it is more or less a drop-in library, in that all you need to do is call `requir
it uses (a few) screenshots in order to isolate drawing operations, which means there are some amusing drawbacks:
-* it's slow
+* `setCanvas()` is fairly expensive
* possible drawing issues if you call `love.graphics.present()` yourself, specifically between `setCanvas()` calls
* canvas width/height cannot exceed the window's width/height, and if your hardware lacks PO2 support, canvases will be further limited to that as well. ie: for an 800x600 display the max canvas size is 512x512. 1024x768 will limit you to 1024x512, and so on.
* any other weirdness you might run across
@@ -39,7 +39,7 @@ so, consider this more of a proof-of-concept than as an actual alternative. get
###API
-fakecanvas directly replaces some of LÖVE's functions, so there are no special functions you need to use. however, the library itself consists of a couple extra functions:
+fakecanvas directly replaces some of LÖVE's functions, so there are no special functions you need to use. however, the library itself consists of some extra functions:
* `enable([state])`: control fakecanvas' usage directly by passing the `state` argument. returns the module, for your chaining pleasure. `state` can be one of:
* `true`: force usage of fakecanvas' functions even if real canvases are supported
@@ -48,6 +48,11 @@ fakecanvas directly replaces some of LÖVE's functions, so there are no special
* `getMaxCanvasSize([hint_w, hint_h])`: returns the maximum size fakecanvas can use for fake canvases. real canvases can likely be made much larger, so this can be used to put an upper limit on their size if needed. for convenience, you can provide width and height hints to this function, which will be clamped if they exceed the maximum size, or returned unmodified if they don't.
+* `setOption(name, value)`: sets the option `name` to `value`. current options are:
+ * `"vflip"`: use vertically-flipped texture coords for the canvas image, to match those of real canvases. visually this makes no difference, but does make a difference inside shaders. if your shaders are not sensitive to this information, you can disable this option and get a possible performance boost. by setting this option before calling `setCanvas()`, you can control this behavior on a per fake canvas basis. boolean: default `true`
+
+* `getOption(name)`: gets the current value of option `name`.
+
### Example main.lua
```lua