> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Guys! I don't get how does "setVolume" work. Let's say we want to play sound louder and louder with every click. I expected something like this, but of course it doesn't work:
(I didn't find examples how to work with SoundChannel)
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Guys, how do we usually stop a fake thread like this? Is it even stoppable?
function pulse()local i=0while(true)do
pulsingSprite:setAlpha((math.sin(i))^2)
i=i+0.1
Core.yield(true)endend
Core.asyncCall(pulse)function onMouseDownFunc()--some command to stop pulsingend
stage:addEventListener(Event.MOUSE_DOWN, onMouseDownFunc)
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
use a global or upvalue as a condition to exit your while loop:
local pulseRunning=truefunction pulse()local i=0while(pulseRunning)do
pulsingSprite:setAlpha((math.sin(i))^2)
i=i+0.1
Core.yield(true)endend
Core.asyncCall(pulse)function onMouseDownFunc()-- pulse thread will exit at next iteration
pulseRunning=falseend
stage:addEventListener(Event.MOUSE_DOWN, onMouseDownFunc)
How to get current frame while MovieClip is playing? Something like:
myAnim = MovieClip.new{{1, 10, myTable[1]},
{10, 20, myTable[2]},
{20, 30, myTable[3]},
}--let's say animation started and we wanna get number of current frame:
currentFrameVar = myAnim:getCurrentFrame()
(I didn't find in documentation)
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
myAnim = MovieClip.new{{1, 10, myTable[1]},
{10, 20, myTable[2]},
{20, 30, myTable[3]},
}--let's say animation started and we wanna get number of current frame:
currentFrameVar =30
myAnim:gotoAndStop(currentFrameVar )
@totebo, the docs are the xml files in the docsrc folder which are edited manually by @hgy29. He then syncs these to the MySQL database.. and then there is a script that converts them into the actual documents. That is my understanding anyway.
I have created a Gideros program that converts all of the XML files into Lua Tables, and then encodes them into JSON strings.
I have been trying to create an editor for these JSON strings but it appears there is no way to accomplish this in a web browser, no way to accomplish this in Gideros (because like no access to ENTER or DELETE keys etc in KeyCode) and currently trying to deserialize the JSON strings in VB.NET has sucked days from my life
I am getting near the point where I think I should throw JSON out the window (and VB.NET) and store everything in a simple text format that is easy to edit.
Guys, what undocumented options are available for Texture.new, besides "wrap = Texture.REPEAT"? What do "format" and "extend" options do? Texture.new(filename, filtering [, options]) http://docs.giderosmobile.com/reference/gideros/Texture/new
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
extend: Boolean indicating if texture should be extended in memory to the next power of two size, default to true format: actual texture format in memory, like RGB, RGBA, Y (greyscale) and so on. Useful when creating textures from byte arrays
function moveBall(event)if ball:hitTestPoint(event.x, event.y)then
ballSprite:setPosition(event.x, event.y)
event:stopPropagation()endend
dragging visually looks same
How to regulate dragging speed? As it is, ball moves instantly, what if we need it slower.
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
For some reason it doesn't work for me, do you know why? (no errors shown, but the ball's drag&drop is broken.
function moveBall(event)
filter=.9
if ballSprite:hitTestPoint(event.x, event.y)then--ballSprite:setPosition(event.x, event.y)local dx = event.x - ballSprite:getX()local dy = event.y - ballSprite:getY()
ballSprite:setX(ballSprite:getX()*filter + dx*(1-filter ))
ballSprite:setY(ballSprite:getY()*filter + dy*(1-filter ))
ballSprite.x0 = event.x
ballSprite.y0 = event.y
event:stopPropagation()endend-- when we move the mouse then ball also moves
ballSprite:addEventListener(Event.MOUSE_MOVE, moveBall)
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Just to muddy the waters here a little but when you have a game object it is a good practice to use a 2D vector to describe it's position in the game world...
-- generally a lot of people use this...local object.x0, object.y0 =320, 160-- this is better
object.position =(x =320, y =160}-- and to access it...local p = object.position
local x0, y0 = p.x, p.y
x0 -=4
y0 +=7
p.x, p.y = x0, y0
The main reason I bring this up is that when you start to create more complex applications and you need help from the internet.. 99% of places you go will be using 2D vectors. Mashing code from online into your own projects becomes much easier
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
it displays "Lua 5.1", while last official Lua version is 5.3.4
Is implementing Lua 5.3.4 too complicated so maintainers decided to skip it? (actually I don't think we're gonna miss anything from 5.3.4, because 5.1 is more than enough for all and everything
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Guys, did I get it right? "Macro Functions" serve the purpose of perfomance only? Or they are also convenient for some other purposes?
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Comments
I'm looking at Lua's table manipulation functions.
table.pack doesn't work in Gideros?
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Let's say we want to play sound louder and louder with every click.
I expected something like this, but of course it doesn't work:
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Likes: Apollo14
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Likes: Apollo14, antix
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Likes: Apollo14
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
Likes: Apollo14
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
I'm talking about it
http://giderosmobile.com/forum/discussion/7215/generated-gideros-api-reference-manual#latest
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
I have created a Gideros program that converts all of the XML files into Lua Tables, and then encodes them into JSON strings.
I have been trying to create an editor for these JSON strings but it appears there is no way to accomplish this in a web browser, no way to accomplish this in Gideros (because like no access to ENTER or DELETE keys etc in KeyCode) and currently trying to deserialize the JSON strings in VB.NET has sucked days from my life
I am getting near the point where I think I should throw JSON out the window (and VB.NET) and store everything in a simple text format that is easy to edit.
Guys, what undocumented options are available for Texture.new, besides "wrap = Texture.REPEAT"? What do "format" and "extend" options do?
Texture.new(filename, filtering [, options])
http://docs.giderosmobile.com/reference/gideros/Texture/new
Likes: totebo
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
format: actual texture format in memory, like RGB, RGBA, Y (greyscale) and so on. Useful when creating textures from byte arrays
Likes: antix, Apollo14
How to regulate dragging speed? As it is, ball moves instantly, what if we need it slower.
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Likes: Apollo14
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Likes: Apollo14
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
I gave a bad example
effect" dragging speed" should be done through the ENTER_FRAME or through Movieclip
Likes: Apollo14
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
Likes: Apollo14
Perfomance-wise, what is a better practice - to always use TTFont.new or Font.new?
There are plenty of them on the web, but their metadata is different from what we need. How to set up their metadata?
Likes: Apollo14
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Likes: Apollo14
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
I think you can adopt a bitmap font with some manual work, not quite sure what's involved though.
Likes: Apollo14
You can generate a bitmap font using Gideros Font Maker and check out the fnt file to see how it is formatted.
Likes: Apollo14
Is implementing Lua 5.3.4 too complicated so maintainers decided to skip it?
(actually I don't think we're gonna miss anything from 5.3.4, because 5.1 is more than enough for all and everything
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Or they are also convenient for some other purposes?
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Likes: antix
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
#1 How does Screen:setPosition() work?
I've tested this line:
This added line doesn't show anything on my Android device:
This method always assigns the same value to 'randNum':
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)