41 #ifndef __CU_PROGRESS_BAR_H__
42 #define __CU_PROGRESS_BAR_H__
43 #include <cugl/2d/CUNode.h>
44 #include <cugl/2d/CUPolygonNode.h>
78 #pragma mark Constructors
104 virtual void dispose()
override;
115 CUAssertLog(
false,
"This node does not support the empty initializer");
131 return initWithCaps(
nullptr,
nullptr,
nullptr,
nullptr,size);
146 bool init(
const std::shared_ptr<Texture>& background) {
147 return initWithCaps(background,
nullptr,
nullptr,
nullptr);
163 bool init(
const std::shared_ptr<Texture>& background,
const Size& size) {
164 return initWithCaps(background,
nullptr,
nullptr,
nullptr,size);
179 bool init(
const std::shared_ptr<Texture>& background,
180 const std::shared_ptr<Texture>& foreground) {
181 return initWithCaps(background,foreground,
nullptr,
nullptr);
197 bool init(
const std::shared_ptr<Texture>& background,
198 const std::shared_ptr<Texture>& foreground,
200 return initWithCaps(background,foreground,
nullptr,
nullptr,size);
217 bool initWithCaps(
const std::shared_ptr<Texture>& background,
218 const std::shared_ptr<Texture>& foreground,
219 const std::shared_ptr<Texture>& beginCap,
220 const std::shared_ptr<Texture>& finalCap);
237 bool initWithCaps(
const std::shared_ptr<Texture>& background,
238 const std::shared_ptr<Texture>& foreground,
239 const std::shared_ptr<Texture>& beginCap,
240 const std::shared_ptr<Texture>& finalCap,
266 #pragma mark Static Constructors
278 static std::shared_ptr<ProgressBar>
alloc(
const Size& size) {
279 std::shared_ptr<ProgressBar> node = std::make_shared<ProgressBar>();
280 return (node->init(size) ? node :
nullptr);
295 static std::shared_ptr<ProgressBar>
alloc(
const std::shared_ptr<Texture>& background) {
296 std::shared_ptr<ProgressBar> node = std::make_shared<ProgressBar>();
297 return (node->init(background) ? node :
nullptr);
313 static std::shared_ptr<ProgressBar>
alloc(
const std::shared_ptr<Texture>& background,
const Size& size) {
314 std::shared_ptr<ProgressBar> node = std::make_shared<ProgressBar>();
315 return (node->init(background,size) ? node :
nullptr);
330 static std::shared_ptr<ProgressBar>
alloc(
const std::shared_ptr<Texture>& background,
331 const std::shared_ptr<Texture>& foreground) {
332 std::shared_ptr<ProgressBar> node = std::make_shared<ProgressBar>();
333 return (node->init(background,foreground) ? node :
nullptr);
349 static std::shared_ptr<ProgressBar>
alloc(
const std::shared_ptr<Texture>& background,
350 const std::shared_ptr<Texture>& foreground,
352 std::shared_ptr<ProgressBar> node = std::make_shared<ProgressBar>();
353 return (node->init(background,foreground,size) ? node :
nullptr);
370 static std::shared_ptr<ProgressBar>
allocWithCaps(
const std::shared_ptr<Texture>& background,
371 const std::shared_ptr<Texture>& foreground,
372 const std::shared_ptr<Texture>& beginCap,
373 const std::shared_ptr<Texture>& finalCap) {
374 std::shared_ptr<ProgressBar> node = std::make_shared<ProgressBar>();
375 return (node->initWithCaps(background,foreground,beginCap,finalCap) ? node :
nullptr);
393 static std::shared_ptr<ProgressBar>
allocWithCaps(
const std::shared_ptr<Texture>& background,
394 const std::shared_ptr<Texture>& foreground,
395 const std::shared_ptr<Texture>& beginCap,
396 const std::shared_ptr<Texture>& finalCap,
398 std::shared_ptr<ProgressBar> node = std::make_shared<ProgressBar>();
399 return (node->initWithCaps(background,foreground,beginCap,finalCap,size) ? node :
nullptr);
423 const std::shared_ptr<JsonValue>& data) {
424 std::shared_ptr<ProgressBar> result = std::make_shared<ProgressBar>();
425 if (!result->initWithData(loader,data)) { result =
nullptr; }
426 return std::dynamic_pointer_cast<Node>(result);
430 #pragma mark Properties