GOOi, an Android-Oriented GUI Library
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: GÖÖi, an Android-Oriented GUI Library
Post a .love file with an example of the problem
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: GÖÖi, an Android-Oriented GUI Library
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
- yetneverdone
- Party member
- Posts: 448
- Joined: Sat Sep 24, 2016 11:20 am
- Contact:
Re: GÖÖi, an Android-Oriented GUI Library
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
Any idea on how to properly make it work?
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
My GameDev Website
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
- yetneverdone
- Party member
- Posts: 448
- Joined: Sat Sep 24, 2016 11:20 am
- Contact:
Re: GÖÖi, an Android-Oriented GUI Library
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 )
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 )
My GameDev Website
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: GÖÖi, an Android-Oriented GUI Library
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)
- yetneverdone
- Party member
- Posts: 448
- Joined: Sat Sep 24, 2016 11:20 am
- Contact:
Re: GÖÖi, an Android-Oriented GUI Library
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.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)
My GameDev Website
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
Going Home:A Pixelated Horror Game
My Repositories!
Follow me lovingly!
Nga pala, pinoy ako.
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: GÖÖi, an Android-Oriented GUI Library
I'm going to check that out, thanks for the heads up!
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: GÖÖi, an Android-Oriented GUI Library
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:
And here's the new look:
This is the new "official" logo:
And here's the new look:
Last edited by alberto_lara on Wed Apr 26, 2017 9:40 pm, edited 3 times in total.
- alberto_lara
- Party member
- Posts: 372
- Joined: Wed Oct 30, 2013 8:59 pm
Re: GÖÖi, an Android-Oriented GUI Library
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:yetneverdone wrote: ↑Mon Apr 10, 2017 3:52 pmApparently ive also tried that method,it didn't work. What worked was that changing then gooi.sx and gooi.sy even wthout a canvas.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)
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
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 ?
Who is online
Users browsing this forum: No registered users and 0 guests