Git Product home page Git Product logo

gooi's People

Contributors

ankit-g avatar flamendless avatar ghtalpo avatar gustavolarabr avatar gustavostuff avatar imagicthecat avatar jamesfalero avatar jmiskovic avatar moomoomoo309 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gooi's Issues

How to use multitouch joysticks, buttons in android screen, and if gooi suport that

ive been trying to make a game, and i start to use gooi for creating joysticks, texts and some buttons on the screen... so when i start moving the player in my game with the joystick i cannot touch other buttons on the screen simultaneous with the joystick. and you can tell me how i can do it? ur wiki and docs dont show anything about it, if you can help me will be usefull

Stopping all other touch input besides pressed button.

Hello! Sorry to bother as I know this is unmaintained however it still works. But I have an issue I'm making a 3d game and if I press any buttons the touch input "goes through" and still moves the camera. I was wondering if with this jn its current state can u make it so when a button is touched that touch wont be used for anything else?

Add button before call "panel:setVisible(false)" will not hide those button

code like below will not hide button which added to panel

require("gooi.gooi")

function love.load()
    local pGrid = gooi.newPanel({x = 0, y = 0, w = 100, h = 100, layout = "grid 1x1"})

    pGrid:setVisible(false) -- first , will not work effect.
    
    local btn = gooi.newButton({text = "hide"})
    btn:onRelease(function () pGrid:setVisible(false) end)
    pGrid:add(btn)

    --pGrid:setVisible(false) -- second
    
    gooi.newButton({x = 100, y = 0, w = 100, h = 100, text = "show"}):onRelease(function ()
        pGrid:setVisible(true)
    end)
end

function love.draw()
    gooi.draw()
end

function love.mousereleased(x, y, button) gooi.released() end
function love.mousepressed(x, y, button)  gooi.pressed() end

and temporary solution is call pGrid:setVisible(false) again after add button

exit button fails from example one

Error: gooi/gooi.lua:2328: attempt to index field 'style' (a nil value)
stack traceback:
gooi/gooi.lua:2328: in function 'getFont'
gooi/gooi.lua:1993: in function 'draw'
main.lua:133: in function 'draw'
[string "boot.lua"]:468: in function <[string "boot.lua"]:436>
[C]: in function 'xpcall'
AL lib: (EE) alc_cleanup: 1 device not closed

--> I'm using this code for one of my projects, I found this issue there.

I've made fixed it for my project if you want I can submit the patch.

Documentation Images 404ing

As in title; the linked images in the readme, and some in the wiki, are not working. When I click through, it seems the host site is down.

Scrolling

I couldn't find anything in the docs and such in regards to scrolling, say text/text buffer. Is this supported and is there an example?

Thanks

phone devices `setTextInput` with area parameters

I don't know if the project is still active, but setTextInput now have parameters for the input area to make sure the virtual keyboard will not hide the field (tested and working on android 8.1).

component specific font not applied [fix included]

encountered an issue,
take the below code

local defaultStyling = {
    bgColor = {12, 183, 242, 170}, -- LOVE blue
    fgColor = {255, 255, 255, 255}, -- Foreground color
    tooltipFont = love.graphics.newFont(10), -- tooltips are smaller than the main font
    radius = 3, -- radius for the outer shapes of components
    innerRadius = 3, -- For the inner ones
    showBorder = false, -- border for components
    borderColor = {12, 183, 242, 255},
    borderWidth = 2, -- in pixels
    font = love.graphics.newFont(48),
    mode3d = false, -- gives that subtle gradient on the given color
    glass = false -- for a glass effect (horizon reflection)
}
  local lab = gooi.newLabel({
    text = "hello my name is bob",
    x = 25,
    y = 150,
    w = 100,
    h = 30,
    align = "left", -- text alignment
    icon = "imgs/exit.png",
})
  lab:setStyle(defaultStyling)

copied directly from the wiki. I changed the style to be font size 48.
When using

gooi.setStyle(defaultStyling)
it is applied to the label, but using

lab:setStyle(defaultStyling)
it is not applied to label.

EDIT
fix found :
changing gooi/gooi.lua line: 1815
from
love.graphics.setFont(gooi.getFont())-- Specific or a common font.
to
love.graphics.setFont(gooi.getFont(comp))-- Specific or a common font.

Groups are confusing.

I don't understand how to use groups, I feel like I had it working for a short period of time then couldn't figure it out again.

Some examples of my issues:

If I go to create a component with the arguments as a table, if I include group as a parameter, the component never gets created?? Or maybe it's never drawn or updated. Not quite sure.

--This Works
jump = gooi.newButton({text = "J"})

--This Does Not
jump = gooi.newButton({text = "J", group = "ingame"})
jump.group = "ingame"

Are groups a private thing for the library it's self? Or am I misunderstanding something? The lack of documentation is very frustrating but this GUI library is the best I've found.

I'd really like to take advantage of gooi.setGroupEnabled() however I may just have to have certain components in a specific table and enable and disable them all over a for loop. component:setEnabled() is working just fine.

Version mismatch

Last Love2D for android version is 10.2. GOOi doesnt work on android...
image

Is there a way to completely treat components as visual?

See subject name.
For example, is there a way to make a couple of buttons and knobs, that do not highlight when your mouse goes over them? That is, without using 'setDisable' on them, because that greys them out automatically.

how i can change text size ?

i have a label in my project and i need to change text size (font size).
how i can do that ?
please some help 🥺 i can't change the library now 😔

Buttons not scaling icon

Might not be intended.
Excuse typos and shorthandedness. Uaing mobile device. Will improve tonight

Changing the drawing of Button.icon touse size of the component will better constrain the clickable space of the button to what is the actual image. Although a separate field iconWidth (iw) and iconHeight (ih) can be get and set for button icon size specifically if one wants the size to he independant.

Use the following in place of sx,sy of the love.draw () call in button:draw ()
sx = self.w/self.icon:getWidth()
sy = self.h/self.icon:getHeight()

The self.# and get# might jeed to be swapped to achieve the scaling. Im not at pc at the moment but my home device has this setup on modified GOOI code

nested panel example

Because the limitation about "panel cannot inside panel" is gone, I try to modify main.lua and add pGame into pGrid.

In my mind, the widget inside pGame will auto resize(or clip) for fixing grid layout.

But I totally mess up as following image:

default

I think it is not bug, but a nested panel demo maybe helpful.

setStyle component change width and height

this time gooi is my preferred library for my projects that need gui for android, but something when I read the code of gooi and it is annoying when applying a style to a component like button the width and height are scaled to the text and not the one that one defines look in the function gooi.setStyleComp

  c.w = s.font:getWidth(c.text) + s.font:getHeight() * 2
  c.h = s.font:getHeight() * 2

is good for label but for button set custom width and height without text is annoying

change it

if c.type == "button" or c.type == "label" or c.type == "label" then
        c.w = s.font:getWidth(c.text) + s.font:getHeight() * 2
        c.h = s.font:getHeight() * 2
end

for this

if c.type == "label" or c.type == "label" then
        c.w = s.font:getWidth(c.text) + s.font:getHeight() * 2
        c.h = s.font:getHeight() * 2
end

Image background for buttons, sliders etc...

Being able to apply images as backgrounds to buttons, sliders and such would be quite handy. I'm trying to look into this myself atm. as I need my sliders to have a gradient background color for my interface.

Keep up the good work 👍

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.