mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Update examples
This commit is contained in:
@@ -1,21 +1,29 @@
|
||||
local component = require("druid.component")
|
||||
|
||||
---@class examples.gamepad_tester: druid.component
|
||||
---@class examples.gamepad_tester: druid.widget
|
||||
---@field root node
|
||||
---@field buttons druid.button
|
||||
---@field buttons_system druid.button
|
||||
---@field button_left_bump druid.button
|
||||
---@field button_right_bump druid.button
|
||||
---@field druid druid.instance
|
||||
local M = component.create("gamepad_tester")
|
||||
---@field button_left druid.button
|
||||
---@field button_right druid.button
|
||||
---@field button_up druid.button
|
||||
---@field button_down druid.button
|
||||
---@field button_x druid.button
|
||||
---@field button_b druid.button
|
||||
---@field button_y druid.button
|
||||
---@field button_a druid.button
|
||||
---@field button_l1 druid.button
|
||||
---@field button_r1 druid.button
|
||||
---@field button_stick_left druid.button
|
||||
---@field button_stick_right druid.button
|
||||
---@field button_start druid.button
|
||||
---@field button_back druid.button
|
||||
---@field trigger_l2 druid.progress
|
||||
---@field trigger_r2 druid.progress
|
||||
---@field stick_left node
|
||||
---@field stick_right node
|
||||
local M = {}
|
||||
|
||||
local STICK_DISTANCE = 50
|
||||
|
||||
---@param template string
|
||||
---@param nodes table<hash, node>
|
||||
function M:init(template, nodes)
|
||||
self.druid = self:get_druid(template, nodes)
|
||||
|
||||
function M:init()
|
||||
self.root = self:get_node("root")
|
||||
|
||||
self.button_left = self.druid:new_button("button_left/button"):set_key_trigger("gamepad_lpad_left")
|
||||
|
Reference in New Issue
Block a user