A sprite that is loaded asynchronously. It can be initialized to either a blank texture or a loading circle, and then given either a URL, file path, or raw image data that will be processed in the background to avoid freezes.
Class LazySprite
#include <Geode/ui/LazySprite.hpp>classLazySprite:publiccocos2d::CCSprite{ ... }
Examples0
Public static methods1
staticgeode::LazySprite*create(cocos2d::CCSizesize,boolloadingCircle)
No description provided
Public member functions14
voidloadFromUrl(std::stringurl,,boolignoreCache)
No description provided
voidloadFromData(,)
No description provided
voidloadFromData(,)
No description provided
voidsetLoadCallback(geode::LazySprite::Callbackcallback)
Set the callback to be called once the sprite is fully loaded, or an error occurred.
callback
The callback
voidsetAutoResize(boolvalue)
Set whether the image will be automatically resized to the size given in the create / init function once it’s loaded. By default is false.
boolisLoaded()
Returns whether the image is now loaded
boolisLoading()
No description provided
voidcancelLoad()
Cancel the sprite loading process. Does nothing if isLoading == false. Callback will not be called, and sprite loading will be halted as soon as possible.
virtualboolinitWithTexture(cocos2d::CCTexture2D*pTexture,,boolrotated)
No description provided
virtualboolinitWithSpriteFrame(cocos2d::CCSpriteFrame*pSpriteFrame)
No description provided
virtualboolinitWithSpriteFrameName(charconst*pszSpriteFrameName)
No description provided
virtualboolinitWithFile(charconst*pszFilename,)
No description provided