{"id":22061846,"url":"https://github.com/rocco-gossmann/raylibtheater","last_synced_at":"2025-03-23T17:28:21.344Z","repository":{"id":238787910,"uuid":"797563046","full_name":"Rocco-Gossmann/RayLibTheater","owner":"Rocco-Gossmann","description":"An easy to use Framework based on RayLib that provides classes for handling Entities and Application-States.","archived":false,"fork":false,"pushed_at":"2024-07-29T04:09:21.000Z","size":331,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"v0.1.0","last_synced_at":"2025-01-28T23:29:27.751Z","etag":null,"topics":["framework","gamedev","gamedev-framework","raylib","raylib-cpp"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rocco-Gossmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-08T04:51:32.000Z","updated_at":"2024-06-05T04:04:27.000Z","dependencies_parsed_at":"2024-05-22T05:30:22.875Z","dependency_job_id":"35b5c88c-b6d2-4a3b-8b33-d9cb61506d3d","html_url":"https://github.com/Rocco-Gossmann/RayLibTheater","commit_stats":null,"previous_names":["rocco-gossmann/raylibtheater"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rocco-Gossmann%2FRayLibTheater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rocco-Gossmann%2FRayLibTheater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rocco-Gossmann%2FRayLibTheater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rocco-Gossmann%2FRayLibTheater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rocco-Gossmann","download_url":"https://codeload.github.com/Rocco-Gossmann/RayLibTheater/tar.gz/refs/heads/v0.1.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245139357,"owners_count":20567162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["framework","gamedev","gamedev-framework","raylib","raylib-cpp"],"created_at":"2024-11-30T18:15:39.223Z","updated_at":"2025-03-23T17:28:21.319Z","avatar_url":"https://github.com/Rocco-Gossmann.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RayTheater\n\nA Wrapper around RayLib, written in C++.\nProviding a Framework to take off some unfun burdens of Software development.\nLike:\n\n- Automatic handeling of Window-Scaling.\n- Switching between different Application-States / Views.\n- Handeling Entities / Entity Components\n\n\n# Why does this exists?\n\nJust because. :-)\n\n(Also, so I can dust of my old C++ Books and maybe produce something that is reusable for other projects for once.)\n\n# How to add this to your own Project.\n\n1.) this is depended on **RayLib** (https://www.raylib.com/)\nSo make sure, you follow their Setup-Guide here first [RayLib - Build and Installation](https://github.com/raysan5/raylib?tab=readme-ov-file#build-and-installation)\n\n2.) Just copy the [RayTheater.hpp](./src/lib/RayTheater.hpp) into your own Project.\n\n2a.) Copy any [Additions](#additions), you want to have into the same folder\n\nThat is it. No further steps needed.\nThe Setup-Process is pretty much inspired by the\n**OneLoneCoder PixelGameEngine** (https://github.com/OneLoneCoder/olcPixelGameEngine)\n(Always loved how simple it is to integrate into existing projects, so I wanted to mimik that)\n\n# Compiler Flags\n\nAll you need is at least C++11 and the IncludePath to your RayTheater.hpp.\nSince this is using RayLib, you obviously also need ot add flags to that lib and headers as well.\n```\n-std=c++11 -I/Path/To/Your/RayTheaterHPP -L/Path/To/RayLib/Lib -I/PathToRayLib/Headers -lraylib\n```\n\n# How to use it in Code.\n\n1.) Include the File\n\n```c++\n#include \"RayTheater.hpp\"\n\nint main() {\n    // ...\n```\n\n2.) define a Scene.\n\n```c++\n#include \"RayTheater.hpp\"\n// Since RayTheater is just a RayLib addon, you have also\n// access any function that RayLibs provides natively.\n#include \u003craylib.h\u003e\n\nclass MyScene : public Theater::Scene {\npublic:\n    void OnStageDraw(Theater::Play p) {\n        // Inside any of the \"...Draw\" method of RayTheater,\n        // you can use RayLibs native Draw function\n        DrawText(\"Hello World\", 8, 8, 20, GREEN);\n    }\n\n    void OnStart(Theater::Play p) { /* Optional override */ }\n    void OnUpdate(Theater::Play p) { /* Optional override */ }\n    void OnWindowDraw(Theater::Play p) { /* Optional override */ }\n    void OnEnd(Theater::Play p) { /* Optional override */ }\n};\n\n\nint main() {\n    // ...\n```\n\n3.) Build the Stage and Play the Scene in your `main` - function\n\n```c++\n\n#include \"RayTheater.hpp\"\n#include \u003craylib.h\u003e\n\nclass MyScene : public Theater::Scene {\n//...\n};\n\nint main() {\n    MyScene ms;\n\n    Theater::Builder(\n        480, // Pixel width of the stage\n        320, // Pixel height of the stage\n        2    // Initial Window Scale (2x)\n    )\n        .Title(\"RayLib - Window 🎉\") // Giving the Window\n        .Play((Theater::Scene*)\u0026ms);\n\n    return 0;\n}\n```\n\nHere is the full version of that code. You can just copy and paste it into your main.cpp, to check if your project setup works.\n\n```c++\n\n#include \"RayTheater.hpp\"\n#include \u003craylib.h\u003e\n\nclass MyScene : public Theater::Scene {\npublic:\n    void OnStageDraw(Theater::Play p) {\n        DrawText(\"Hello World\", 8, 8, 20, GREEN);\n    }\n};\n\nint main() {\n    MyScene ms;\n\n    Theater::Builder(480, 320,  2)\n        .Title(\"RayLib - Window 🎉\")\n        .Play((Theater::Scene*)\u0026ms);\n\n    return 0;\n}\n```\n\n# Documentation\n\n- [Theater::Builder](./docs/builder.md)  \n  the entrypoint to your application.\n\n- [Theater::Scene](./docs/scenes.md)  \n  is used to manage various actors within the application.\n\n- [Theater::Play](./docs/play.md)   \n  Is proveded to The Scene and All Actors while the Scene is running.\n\n  - [Theater::Stage](./docs/stage.md)  \n    Provided through Theater::Play and is used to Add, Read, Remove or Modify Actors on the Stage.\n\n- [Theater::Actor](./docs/actors.md)  \n  These are the small entities that make up your Application\n\n  - [Components](./docs/components.md)\n      - [Theater::Colliders](./docs/components.md#collider---components)  \n        Components, that describe an Actors shape for the Collision check.\n\n      - [Theater::Visible](./docs/components.md#visible---component)  \n        Allows an Actor to visually show up on the stage.\n\n      - [Theater::Ticking](./docs/components.md#ticking---component)  \n        Allows an Actor to interact with the stage, even when not visible.\n        \n      - [Theater::Transform2D](./docs/components.md#transform2d---component)  \n        [!todo]\n        Allows other Actors or the Scene to manipulate the actors positioning on the stage.\n\n  - Attributes [!todo]\n\n\n# Advanced Techniques (Pre-Compiler Magic)\n\n- [Custom-Attributes](./docs/custom_attributes.md)\n\n# Additions\n\n## RayTheaterUI.hpp\nContains predefined Actor-Classes, that can play UI-Components like Buttons and Labels  \n[goto Documentation](./docs/additions/ui.md)\n\n- [Buttons](./docs/additions/ui/button.md) \n- [Labels](./docs/additions/ui/label.md)\n- [Theming/Styling](./docs/additions/ui/style.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocco-gossmann%2Fraylibtheater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frocco-gossmann%2Fraylibtheater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocco-gossmann%2Fraylibtheater/lists"}