GAMEFROMSCRATCH.COM
Defold Druid UI Framework
Defold Druid UI Framework / News / October 28, 2024 / Defold, FrameworkThe DrUId framework for the Defold game engine just turned 1.0. DrUId, as the capitalization suggests, is a UI framework for the defold game engine. The project is open source and released under the MIT license.Defold Druid is described as:Druid powerfulDefoldcomponent UI framework that empowers developers to create stunning and customizable GUIs by leveraging a wide range of embedded components or effortlessly designing their own game-specific components.Druid comes with several examples to get you started. Here is an example of Druid source code, setting up Druid and creating a Button:local druid = require("druid.druid")-- All component callbacks pass "self" as first argument-- This "self" is a context data passed in `druid.new(context)`local function on_button_callback(self) print("The button clicked!")endfunction init(self) self.druid = druid.new(self) self.button = self.druid:new_button("button_node_name", on_button_callback)end-- "final" is a required function for the correct Druid workflowfunction final(self) self.druid:final()end-- "update" is used in progress bar, scroll, and timer basic componentsfunction update(self, dt) self.druid:update(dt)end-- "on_message" is used for specific Druid events, like language change or layout changefunction on_message(self, message_id, message, sender) self.druid:on_message(message_id, message, sender)end-- "on_input" is used in almost all Druid components-- The return value from `druid:on_input` is required!function on_input(self, action_id, action) return self.druid:on_input(action_id, action)endKey LinksDruid GitHubDefold Game EngineYou can learn more about the excellent Defold Game Engine and the Druid UI framework in the video below.
0 التعليقات 0 المشاركات 65 مشاهدة