CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
UILayer.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2023 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
12
15
16namespace CeresEngine {
17
18 class UILayer : public RefCounted<UILayer> {
19 private:
22
25
28
29 double mOpacity = 1.0;
30 bool mOpaque = true;
31
32 AffineTransform mTransform;
33 AffineTransform mSubLayerTransform;
34
38
39 public:
42
43 public: // Hierarchy
46
50
51 public: // Displaying & rendering
52 void display(UIGraphicsContext& context);
54 virtual void draw(UIGraphicsContext& context);
55
58 void setNeedsDisplay(const UIRect& rect);
59 };
60
62 using UILayerPtr = RC<UILayer>;
63
66 private:
68
69 public:
70 void render(UIGraphicsContext& context);
71 };
72
73} // namespace CeresEngine
A retain-release type of smart pointer.
Definition SmartPtr.hpp:132
An object that represents a graphics context.
Definition GraphicsContext.hpp:45
A simple reference counter base class.
Definition SmartPtr.hpp:438
A context object that contains the UILayer.
Definition UILayer.hpp:65
UILayerPtr mLayer
Definition UILayer.hpp:67
void render(UIGraphicsContext &context)
Definition UILayer.hpp:18
UIRect mFrame
Definition UILayer.hpp:27
void replaceSublayer(UILayer *layer, UILayer *other)
double mOpacity
Definition UILayer.hpp:29
bool mOpaque
Definition UILayer.hpp:30
UIRect mBounds
Definition UILayer.hpp:26
UIPoint mPosition
Definition UILayer.hpp:24
const Vector< UILayerPtr > & getSubLayers() const noexcept
Definition UILayer.hpp:45
UILayer * mSuperLayer
Definition UILayer.hpp:20
UIBackingStorePtr mBackingStore
A backing store for the view contents.
Definition UILayer.hpp:37
UIPoint mAnchorPoint
Definition UILayer.hpp:23
void addSublayer(UILayer *layer)
void displayIfNeeded(UIGraphicsContext &context)
UILayer() noexcept=default
AffineTransform mTransform
Definition UILayer.hpp:32
AffineTransform mSubLayerTransform
Definition UILayer.hpp:33
void display(UIGraphicsContext &context)
UILayer * getSuperLayer() const noexcept
Definition UILayer.hpp:44
virtual void draw(UIGraphicsContext &context)
void setNeedsDisplay(const UIRect &rect)
Vector< UILayerPtr > mSubLayers
Definition UILayer.hpp:21
Definition Application.hpp:19
std::vector< T, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > Vector
Vector is a sequence container that encapsulates dynamic size arrays.
Definition Vector.hpp:17
Rect2 UIRect
A structure that contains the location and dimensions of a rectangle.
Definition UIUtility.hpp:33
Point2 UIPoint
A type that contains a point in a two-dimensional coordinate system.
Definition UIUtility.hpp:27
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25