From e6ac189e5aea4a770389654d26a1449db36b44f4 Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Thu, 19 May 2022 22:18:48 +0200 Subject: [PATCH] Created Image (markdown) --- Image.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Image.md diff --git a/Image.md b/Image.md new file mode 100644 index 0000000..bca2405 --- /dev/null +++ b/Image.md @@ -0,0 +1,36 @@ +The image object is for adding more advanced backgrounds. +It also provides a :shrink() function, where you can shrink the images to smaller ones. This functionallity is fully provided by the blittle library created by Bomb Bloke. I did not ask for permission to add it into the framework. If the creator wants me to remove the blittle part, just text me on discord! + +Here are all possible functions available for image: +Remember image inherits from [object](https://github.com/NoryiE/NyoUI/wiki/Object): + + +## loadImage +loads a image into the memory. +````lua +local mainFrame = basalt.createFrame("myFirstFrame"):show() +local aButton = mainFrame:addImage("myFirstImage"):loadImage("randomImage.nfp") +```` +**Arguments:** string path
+**returns:** self
+ + +## loadBlittleImage -- not finished yet +loads a blittle image into the memory. +````lua +local mainFrame = basalt.createFrame("myFirstFrame"):show() +local aButton = mainFrame:addImage("myFirstImage"):loadBlittleImage("blittleImage.") +```` +**Arguments:** string path
+**returns:** self
+ +## shrink +If you were loading a normal (paint) image into the memory, this function would shrink it to a +blittle image and immediatly draws it (if it's visible) +````lua +local mainFrame = basalt.createFrame("myFirstFrame"):show() +local aButton = mainFrame:addImage("myFirstImage"):loadBlittleImage("randomImage.nfp"):shrink() +```` +**Arguments:** -
+**returns:** self
+