Brunot
Loading...
Searching...
No Matches
Background.h
Go to the documentation of this file.
1
11// ____ __ __ __
12// /\__ _\/\ \ /\ \/\ \
13// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
14// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
15// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
16// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
17// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
18
19
20// File: Background.h
21// Description: The component that holds the texture behind everything
22// Author(s): Bryley Elder (bryley.elder@digipen.edu)
23// 2025 / 11 / 21
24// (C) Digipen 202
25// ____ __ __ __
26// /\__ _\/\ \ /\ \/\ \
27// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
28// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
29// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
30// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
31// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
32
33#pragma once
34#include "Framework/Component.h"
35
40class Background : public Component
41{
42public:
43 Background();
44 Background(const Background&) = default;
45 auto operator=(const Background&) -> Background& = default;
46 ~Background() override = default;
47 Background(Background&& other) noexcept = default;
48 auto operator=(Background&& other) noexcept -> Background& = default;
49
50 auto clone() const -> std::unique_ptr<GameObject> override;
51
52 auto componentShowMenu() -> void override
53 {
54 } // for debug ImGUI
55 auto onUpdate(float dt) -> void override;
56
57 auto endWindow() -> void override
58 {
59 }; // for debug ImGUI
60 auto onRender() -> void override;
61 auto load(Stream& stream) -> void override;
62 auto save(Stream& stream) const -> void override;
63
64 friend auto to_json(json& j, const Background& p) -> void;
65 friend auto from_json(const json& j, Background& p) -> void;
66
67};
sys::Json Stream
Definition AudioObject.h:20
The base class for components, holding all of their shared All components should inherit from this.
nlohmann::json json
Definition Json.cpp:19
The component tthat holds the texture behind everything.
Definition Background.h:41
Background()
Definition Background.cpp:38
friend auto from_json(const json &j, Background &p) -> void
Definition Background.cpp:84
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition Background.cpp:43
Background(const Background &)=default
auto load(Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition Background.cpp:67
friend auto to_json(json &j, const Background &p) -> void
Definition Background.cpp:77
auto operator=(const Background &) -> Background &=default
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition Background.h:57
Background(Background &&other) noexcept=default
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition Background.cpp:72
~Background() override=default
auto onUpdate(float dt) -> void override
called once every frame.
Definition Background.cpp:48
auto componentShowMenu() -> void override
Definition Background.h:52
auto operator=(Background &&other) noexcept -> Background &=default
auto onRender() -> void override
called every frame after update has been called for every object.
Definition Background.cpp:63
Component(ComponentTypeEnum type, const char *typeName)
Definition Component.cpp:72
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:23