MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / TEST_Patches

Class TEST_Patches

examples/TEST_Patches.cpp:58–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56
57
58class TEST_Patches : public olc::PixelGameEngine
59{
60public:
61 TEST_Patches()
62 {
63 sAppName = "Testing Patches";
64 }
65
66 std::unique_ptr<olc::Sprite> pSprite;
67 std::unique_ptr<olc::Decal> pDecal;
68
69public:
70 bool OnUserCreate() override
71 {
72 pSprite = std::make_unique<olc::Sprite>("./assets/DirectionalSolids.png");
73 pDecal = std::make_unique<olc::Decal>(pSprite.get());
74 return true;
75 }
76
77
78 bool OnUserUpdate(float fElapsedTime) override
79 {
80
81 Clear(olc::TANGERINE);
82 DrawSprite({ 10,10 }, pSprite.get());
83
84 /*DrawSprite(
85 olc::vf2d(GetMousePos()),
86 pSprite->Patch({ 16, 0 }, { 16, 16 }),
87 { -30.0f, -30.0f });
88
89 DrawSprite(
90 olc::vf2d(GetMousePos()),
91 pSprite->Patch({ 0.25f, 0.5f }, { 0.5f, 0.0f }, { 0.75f, 0.5f }, { 0.5f, 1.0f }),
92 { 100.0f, 100.0f });
93
94 DrawSprite(
95 olc::vf2d(GetMousePos()),
96 *pSprite,
97 { 50.0f, -50.0f });*/
98
99
100
101 DrawDecal(
102 olc::vf2d(GetMousePos()),
103 pDecal->Patch({ 16, 0 }, { 16, 16 }),
104 { -30.0f, -30.0f });
105
106 DrawDecal(
107 olc::vf2d(GetMousePos()),
108 pDecal->Patch({ 0.25f, 0.5f }, { 0.5f, 0.0f }, { 0.75f, 0.5f }, { 0.5f, 1.0f }),
109 { 100.0f, 100.0f });
110
111 DrawDecal(
112 olc::vf2d(GetMousePos()),
113 *pDecal,
114 { 320.0f, -180.0f });
115

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected