improvements to orx-object-fit -> orx-image-fit

This commit is contained in:
pfs-15
2020-02-10 19:27:53 +01:00
parent aea681446e
commit 3c3e6eed08
4 changed files with 86 additions and 87 deletions

20
orx-image-fit/README.md Normal file
View File

@@ -0,0 +1,20 @@
# orx-image-fit
Fits images in frames with two options, contain and cover. Similar to CSS object-fit (https://www.w3schools.com/css/css3_object-fit.asp)
## usage
`imageFit(img: ColorBuffer, x: Double, y: Double, w: Double, h: Double, fitMethod, horizontalPosition:Double, verticalPosition:Double)`
fitMethod
- `contain`
- `cover`
horizontal values
- left ... right
- `-1.0` ... `1.0`
vertical values
- top ... bottom
- `-1.0` ... `1.0`