Fixed typos and cleaned up code in the Images library (#93)
* Updated setTheme.md * Updated 1.6 setTheme.md * Fixed typo * Cleaned up loadImage functions * Changed it to use the new function * More typos --------- Co-authored-by: SeaSide53 <https://github.com/SeaSide53>
This commit is contained in:
@@ -27,24 +27,29 @@ local function loadBBFAsBimg(path)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function loadImage(path, f, binaryMode)
|
local function loadImage(path, binaryMode)
|
||||||
if(sub(path, -4) == ".bimg")then
|
--Loads the image with the right loader, returns error if the file type is unknown.
|
||||||
|
if(sub(path, -5) == ".bimg")then
|
||||||
return loadBIMG(path, binaryMode)
|
return loadBIMG(path, binaryMode)
|
||||||
elseif(sub(path, -3) == ".bbf")then
|
elseif(sub(path, -4) == ".bbf")then
|
||||||
return loadBBF(path, binaryMode)
|
return loadBBF(path)
|
||||||
|
elseif(sub(path, -4) == ".nfp")then
|
||||||
|
return loadNFP(path)
|
||||||
else
|
else
|
||||||
return loadNFP(path, binaryMode)
|
error("Unknown file type")
|
||||||
end
|
end
|
||||||
-- ...
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function loadImageAsBimg(path)
|
local function loadImageAsBimg(path, binaryMode)
|
||||||
if(path:find(".bimg"))then
|
--Loads the image with the right Bimg loader, returns error if the file type is unknown.
|
||||||
return loadBIMG(path)
|
if(sub(path, -5) == ".bimg")then
|
||||||
elseif(path:find(".bbf"))then
|
return loadBIMG(path, binaryMode)
|
||||||
|
elseif(sub(path, -4) == ".bbf")then
|
||||||
return loadBBFAsBimg(path)
|
return loadBBFAsBimg(path)
|
||||||
else
|
elseif(sub(path, -4) == ".nfp")then
|
||||||
return loadNFPAsBimg(path)
|
return loadNFPAsBimg(path)
|
||||||
|
else
|
||||||
|
error("Unknown file type")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ return function(name, basalt)
|
|||||||
|
|
||||||
loadImage = function(self, path)
|
loadImage = function(self, path)
|
||||||
if(fs.exists(path))then
|
if(fs.exists(path))then
|
||||||
local newBimg = images.loadBIMG(path)
|
local newBimg = images.loadImageAsBimg(path)
|
||||||
bimgLibrary = bimg(newBimg)
|
bimgLibrary = bimg(newBimg)
|
||||||
activeFrame = 1
|
activeFrame = 1
|
||||||
bimgFrame = bimgLibrary.getFrameObject(1)
|
bimgFrame = bimgLibrary.getFrameObject(1)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
## add<Object>
|
## add<Object>
|
||||||
Adds a new object. Don't use add<Object> please use addTheObjectYouNeed For example if you want a new Frame, use
|
Adds a new object. Don't use add<Object> please use addTheObjectYouNeed. For example if you want a new Frame, use
|
||||||
addFrame, if you want to add a button, use addButton
|
addFrame, if you want to add a button, use addButton.
|
||||||
|
|
||||||
#### Parameters:
|
#### Parameters:
|
||||||
1. `string` optional - the id if you don't add a id it will autimatically generate one for you
|
1. `string` optional - the id if you don't add a id it will automatically generate one for you
|
||||||
|
|
||||||
#### Returns:
|
#### Returns:
|
||||||
1. `object` The new object you've created
|
1. `object` The new object you've created
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
The Image object is designed for adding more advanced backgrounds to your interface. It supports the loading of .nfp and .bimg images, allowing for greater customization of your interface's appearance.
|
The Image object is designed for adding more advanced backgrounds to your interface. It supports the loading of .nfp and .bimg images, allowing for greater customization of your interface's appearance.
|
||||||
|
|
||||||
In addition to the Object and VisualObject methods, Progressbar objects have the following methods:
|
In addition to the Object and VisualObject methods, Image objects have the following methods:
|
||||||
|
|
||||||
| | |
|
| | |
|
||||||
|---|---|
|
|---|---|
|
||||||
|
|||||||
Reference in New Issue
Block a user