23#define KTECH_DEFINITION
24#include "../ktech.hpp"
25#undef KTECH_DEFINITION
26#include "../utility/id.hpp"
27#include "../basic/cell.hpp"
28#include "../basic/point.hpp"
29#include "../basic/upoint.hpp"
68 virtual auto OnTick() -> bool;
71 inline void RenderBackground();
72 inline void RenderSimple(uint8_t layerAlpha,
Object*
object,
Texture& texture);
73 inline void RenderComplex(uint8_t layerAlpha,
Object*
object,
Texture& texture);
74 inline void RenderForeground(
const RGBA& frgba,
const RGBA& brgba);
World structure that renders Objects of Layers, and exists within Map.
Definition camera.hpp:41
Point m_pos
World position.
Definition camera.hpp:48
ID< Map > m_parentMap
The map which contains this Camera.
Definition camera.hpp:46
void Resize(UPoint resolution)
Resize the image resolution (or "size").
Definition camera.cpp:116
std::vector< Cell > m_image
Cell-based rendered image.
Definition camera.hpp:51
Cell m_background
The background to render upon.
Definition camera.hpp:50
Camera(Engine &engine, Point position=Point(0, 0), UPoint resolution=UPoint(10, 10), const std::string &name="")
Prepare Camera for rendering.
Definition camera.cpp:41
virtual auto OnTick() -> bool
Virtual function called once each tick.
Definition camera.cpp:228
UPoint m_res
Camera::m_image's resolution (or "size").
Definition camera.hpp:49
void Render()
Render all Objects of all Layers of the parent Map.
Definition camera.cpp:125
void Draw(Point position=Point(0, 0), UPoint start=UPoint(0, 0), UPoint end=UPoint(0, 0), uint8_t alpha=std::numeric_limits< uint8_t >::max())
Draw the rendered image (Camera::m_image) to Output so it can be printed to the terminal.
Definition camera.cpp:182
const ID< Camera > m_id
Personal ID.
Definition camera.hpp:44
auto EnterMap(const ID< Map > &map) -> bool
Enter a parent Map.
Definition camera.cpp:84
void RenderDrawPrint()
Shortcut for Camera::Render(), Camera::Draw() and Output::Print().
Definition camera.cpp:198
virtual ~Camera()
Leave the parent map (if in one) and removed itself from Memory.
Definition camera.cpp:67
Engine & engine
Parent engine.
Definition camera.hpp:43
auto LeaveMap() -> bool
Leave the parent Map.
Definition camera.cpp:100
std::string m_name
String name, might be useful for debugging.
Definition camera.hpp:45
Complete engine containing all engine components.
Definition engine.hpp:41
Engine component responsible for registering all world structures.
Definition memory.hpp:36
World structure that comprises Textures and Colliders, and exists within Layer.
Definition object.hpp:37
Terminal cell comprising RGB foreground (character) color, RGB background color, and an ASCII charact...
Definition cell.hpp:31
Serializable world structure identifier.
Definition id.hpp:38
2D vector, mostly used to store positions and directions.
Definition point.hpp:30
Like RGB, but also has an alpha channel representing transparency.
Definition rgba.hpp:30
24-bit color, able of representing 16,777,216 (2^24) different colors.
Definition rgb.hpp:29
A CellA-based sprite.
Definition texture.hpp:48
Unsigned 2D vector, mostly used to store sizes and 2D indexes.
Definition upoint.hpp:29