Page 9 of 14

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Wed Feb 22, 2017 12:44 pm
by Positive07
Post a .love file with an example of the problem

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Mon Mar 13, 2017 8:27 pm
by alberto_lara
Hey guys just to let you know I just released version 0.0.3 of GÖÖi, the main changes are these:
  • Added multiline labels
    Now labels can have a text with new line ("\n") characters, multiline alignment works fine now.
  • Added multiline buttons
    Same for buttons
  • Modal improvements
    Modals can be created like this now:

    Code: Select all

    gooi.alert({
        msg = "This is an alert!",
        ok = function()
            gooi.alert("You pressed Yup")
        end,
        okText = "Yup"
    })
    gooi.confirm({
        msg = "Do you like GÖÖi?",
        ok = function()
            gooi.alert("Yay!")
        end,
        cancel = function()
            gooi.alert(":(")
        end,
        okText = "Yup",
        cancelText = "Nope"
    })
    
  • Joystick improvements
    Now the Joystick component is probably the most flexible one, it can be used/created with these configurations (and they can be used in any combination):
    • Code: Select all

      -- Normal joystick, it will be moved when clicking/touching over the white circle or image:
      gooi.newJoy()
      
    • Code: Select all

      -- Image Joystick, it will replace the white circle by an image, scaled to keep the same proportions:
      gooi.newJoy():setImage("/imgs/cat.png")
      
    • Code: Select all

      -- No spring, the image or circle won't return to the center place once released:
      gooi.newJoy():noSpring()
      
    • Code: Select all

      -- This will cause to draw the image with scale = 1:
      gooi.newJoy():setImage("/imgs/cat.png"):noScaling()
      
    • Code: Select all

      -- So you don't need to touch/click over the circle or image to actually move the joystick:
      gooi.newJoy():anyPoint()
      
    • Code: Select all

      -- Converts from analog to a digital one, 8 directions
      -- (with this enabled, use Joystick:direction() to get the value, not xValue() or yValue()):
      gooi.newJoy():setDigital()
      
  • Fixed: apply style to children when applying to panel

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Sat Apr 01, 2017 6:35 am
by yetneverdone
Im having problem using the joystick, it seems that I can't make the circle move

EDIT:
It seems that the gooi.pressed and gooi.released need argument to properly work.

Althought it is misbehaving since im using these mouse coordinates

Code: Select all

local mx = love.mouse.getX()/ratio
local my = love.mouse.getY()/ratio
Any idea on how to properly make it work?
animation.gif
animation.gif (140.76 KiB) Viewed 9471 times

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Sun Apr 02, 2017 12:21 pm
by yetneverdone
Ooooops. Nevermind, Ive fixed it though.

Apparently i need to change gooi.sx and gooi.sy to my game's ratio

OP, you should definitely add the instruction to change the gooi.sx and gooi.sy to the game's proper ratio in the wiki. (Or i might just do that seeing that the wiki page is open for changes :))

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Mon Apr 10, 2017 3:09 pm
by alberto_lara
Hey, sorry for the delay... and you're right, you should use gooi.setCanvas(myCanvas) right after you create the canvas for your game (this changes gooi.sx and gooi.sy)

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Mon Apr 10, 2017 3:52 pm
by yetneverdone
alberto_lara wrote: Mon Apr 10, 2017 3:09 pm Hey, sorry for the delay... and you're right, you should use gooi.setCanvas(myCanvas) right after you create the canvas for your game (this changes gooi.sx and gooi.sy)
Apparently ive also tried that method,it didn't work. What worked was that changing then gooi.sx and gooi.sy even wthout a canvas.

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Tue Apr 11, 2017 3:34 pm
by alberto_lara
I'm going to check that out, thanks for the heads up!

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Tue Apr 25, 2017 9:18 pm
by alberto_lara
Hi, I've made some changes to GOOi and it's now in version 0.0.4. (not "GÖÖi" anymore, just GOOi)

This is the new "official" logo:
Image

And here's the new look:
Image

Re: GÖÖi, an Android-Oriented GUI Library

Posted: Tue Apr 25, 2017 10:41 pm
by alberto_lara
yetneverdone wrote: Mon Apr 10, 2017 3:52 pm
alberto_lara wrote: Mon Apr 10, 2017 3:09 pm Hey, sorry for the delay... and you're right, you should use gooi.setCanvas(myCanvas) right after you create the canvas for your game (this changes gooi.sx and gooi.sy)
Apparently ive also tried that method,it didn't work. What worked was that changing then gooi.sx and gooi.sy even wthout a canvas.
I've used this code in the new version and it seems to work well, I didn't move anything related to scaling so it should work in version 0.0.3 as well:

Code: Select all

require "gooi"

function love.load()
    gr = love.graphics

    canvas = gr.newCanvas(150, 100)
    canvas:setFilter("nearest", "nearest")
    sx = gr.getWidth() / canvas:getWidth()
    sy = gr.getHeight() / canvas:getHeight()

    gooi.setCanvas(canvas)
    gooi.newJoy({size = 30})
end

function love.update(dt)
    gooi.update(dt)
end

function love.draw()
    gr.setCanvas(canvas)
    gr.clear(0, 0, 0)
    gooi.draw()
    gr.setCanvas()
    gr.draw(canvas, 0, 0, 0, sx, sy)
end

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

Re: GOOi, an Android-Oriented GUI Library

Posted: Tue May 02, 2017 7:22 am
by lgktg
I tried to adapt the librairy to work with cameras (http://nova-fusion.com/2011/04/19/camer ... he-basics/) by modifying gooi.pressed() but i wasn't able to make it work. Any advices ?