{"id":"thegalaxydev/bee2d","name":"bee2d","scope":"thegalaxydev","platform":"roblox","description":"A game engine within a game engine designed to make functional and optimized 2D games.","version":"0.1.4","latest":"0.1.4","versions":["0.1.0","0.1.1","0.1.2","0.1.3","0.1.4"],"license":"MIT","licenseRating":"safe","licenseCaveats":["License identified from the packaged LICENSE file; the manifest declared none."],"licenseVerified":true,"dependencies":{},"integrity":"057d36c47786c338ed6c57a62548afa96b13c1a7af771bd2a8d7fa614a681a39","likes":0,"downloads":0,"install":"forest install thegalaxydev/bee2d","url":"https://forest.dev/p/roblox/thegalaxydev/bee2d","files":"https://api.forest.dev/ai/package/roblox/thegalaxydev/bee2d/files","readme":"# Bee2D\r\n\r\nBee2D is a semi-barebones 2D game engine integrated into Roblox. Simply download the repo and run the `default.project.json` with Rojo to clone it into your game. Additionally, you can add it straight into your game with the model below:\r\nhttps://www.roblox.com/library/12159480029/Bee2D\r\n\r\nDiscord Server: https://discord.gg/ptNSRYcvr9\r\n\r\n\r\n# Getting Started\r\n\r\nBee2D has a bit of a learning curve, but once you get into it, it's extremely simple. To start out, simply require the `Main` and `Engine` modules from Bee2D like so:\r\n\r\n```lua\r\nlocal Engine = require(Services.ReplicatedStorage.Bee2D.Engine)\r\nlocal Bee2D = require(Services.ReplicatedStorage.Bee2D)\r\n```\r\n\r\nFrom there, there's a couple of built-in functions you can set up.\r\n\r\n```lua\r\nEngine.BindToUpdate(\"Name\", function(deltaTime)\r\n\t-- This will allow you to bind functions to the update calls of the engine. \r\n\t--Engine.Update(deltaTime) runs every frame.\r\n\t-- The first argument, \"Name\", is what you will use to unbind the function.\r\nend)\r\n\r\nEngine.BindToDraw(\"Name\", function()\r\n\t-- This will allow you to bind functions to the draw calls of the engine. \t\r\n\t-- Engine.Draw() runs every frame after Engine.Update() is called.\r\n\t-- The first argument, \"Name\", is what you will use to unbind the function.\r\nend)\r\n```\r\n\r\nIn order to unbind these functions, it's as simple as running the following:\r\n\r\n```lua\r\nEngine.UnbindFromUpdate(\"Name\")\r\nEngine.UnbindFromDraw(\"Name\")\r\n```\r\n\r\nThis engine runs with modules called `Scenes`. Scenes have their own `Start`, `Update`, and `Draw` functions which are called with the Engine. To set up your scenes, simply make a folder for them and load them with the following:\r\n\r\n```lua\r\nEngine.LoadScenes(ScenesFolder)\r\n```\r\n\r\nA scene is set up like such:\r\n\r\n```lua\r\n-- First you want to include the Scene module, as it sets up the class for you to use.\r\nlocal Scene = require(ReplicatedStorage.Bee2D.Components.Scene)\r\n\r\n-- Then you can set up your Scene like such:\r\n\r\nlocal YourSceneName = Scene.new()\r\nYourSceneName.Prioritize = true -- This will make this scene the current active scene when it is loaded. This means that it will be displayed immediately.\r\n\r\nfunction YourSceneName:Start()\r\n-- This will run once when the scene is loaded.\r\nend\r\n\r\nfunction YourSceneName:Update(deltaTime)\r\n-- This will run every frame.\r\nend\r\n\r\nfunction YourSceneName:Draw()\r\n-- This will run every frame after Update, and is used to render images and geometry.\r\nend\r\n```\r\n\r\nBee2D's Main module also has some neat functions for you to use.\r\n\r\n```lua\r\nfunction Bee2D.DrawFPS()\r\n-- Displays the FPS on screen in the top right corner.\r\n\r\nfunction Bee2D:SetFullScreen(boolean)\r\n-- Will make the window take up the entire screen.\r\n\r\nfunction Bee2D.DrawImage(texture: string, position: Vector2, rotation: number, scale: Vector2, tint: Color3)\r\n-- Will draw an image on screen given the texture (roblox image link).\r\n\r\nfunction Bee2D.DrawRectangle(posX: number, posY: number, width: number, height: number, color: Color3)\r\n-- Will draw a rectangle on screen given a position, width, and height.\r\n\r\nfunction Bee2D.DrawRectangleEx(posX: number, posY: number, width: number, height: number, rotation: number, color: Color3)\r\n-- Will draw a rectangle on screen same as above, but includes rotation.\r\n\r\nfunction Bee2D.DrawText(text: string, posX: number, posY: number, color: Color3, font: Enum.Font, size: number)\r\n-- Displays text on screen\r\n\r\nfunction Bee2D.DrawLine(lineStart: Vector2, lineEnd: Vector2, width: number, color: Color3)\r\n-- Draws a line on screen given a start and end. May be buggy.\r\n\r\nfunction Bee2D.DrawCircleLine(posX: number, posY: number, radius: number, color: Color3)\r\n-- Draws a circle out of lines.\r\n```\r\n\r\n## Actors\r\n\r\nActors are more advanced objects that are displayed in a scene.\r\nActors also have a Start, Update, and Draw function that can be overriden. These functions are run when you add the actor to a scene like such:\r\n```lua\r\nlocal Actor = require(ReplicatedStorage.Bee2D.Source.Actor)\r\nlocal Sprite = require(ReplicatedStorage.Bee2D.Source.Interface.Sprite)\r\n-- Sprite class is used to display the actor\r\n\r\nlocal Player = YourSceneName:AddActor(Actor.new(\"Player\",  Sprite.new(Color3.new(1,1,1), \"imagelinkhere\")))\r\n```\r\n\r\nAdditionally, actors can be moved, scaled, and rotated by their Transform properties, and also can be given collision.\r\n\r\n```lua\r\nPlayer.Transform:SetLocalPosition(Vector2.new(1,1))\r\n```\r\nMore information regarding Transforms can be seen below.\r\n\r\n## Transform\r\nWIP\r\n\r\n\r\n\r\n\r\n\r\n\r\n","readmeTruncated":false}