Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Quick questions about Gideros&Lua - Page 12 - Gideros Forum

Quick questions about Gideros&Lua

167891012»

Comments

  • olegoleg Member
    hgy29 said:

    Just had a try and admob compiles fine for me, even without google play enabled in gaming plugin

    may be the reason that i have "windows 7" ??
  • olegoleg Member
    hgy29 said:

    Could it be that you have googleplay plugin enabled too ? There are three plugins in which to set up google play services: gaming, googleplay (which should no longer be used), and ads (and firebase for those who have it). All these plugins must ask the same version of google services


  • keszeghkeszegh Member
    edited October 18
    guys, can you tell me how to get the color of a specific pixel on screen in the latest gideros version? thanks
  • SinisterSoftSinisterSoft Maintainer
    edited October 18
    You can't get the colour of a specific pixel on the screen. You could draw the screen to a rendertexture then get the colour of the pixel from that?

    Likes: antix, keszegh

    +1 -1 (+2 / -0 ) Share on Facebook
  • keszeghkeszegh Member
    edited October 19
    for your information i did it the following way:
    local _backgroundcolor=0
     
    function colorPicker(x,y)
    if not rtColorPicker then rtColorPicker=RenderTarget.new(1,1) end
    rtColorPicker:clear(_backgroundcolor)
    rtColorPicker:draw(stage,-x,-y)
    local col=rtColorPicker:getPixel(0,0)      
    return col
    end
    +1 -1 (+3 / -0 ) Share on Facebook
  • hgy29hgy29 Maintainer
    Great hack @keszegh, perfect solution for current gideros.
  • Apollo14Apollo14 Member
    edited October 20
    Hey guys! Something is wrong in my syntax, what can it be?
    (update: uh, the problem was in local scope, I just didn't understand it from console error log)
    dialogText = TextField.new(Roboto_font, "")
    dialogBox:addChild(dialog_BottomText)
     
    function sayDialogBottom(content)
    	print"bottom dialog started" --function never starts
    	for i=1, #content do
    		Core.yield(0.03)
    		dialogText:setText(utf8.sub(content,1,i))
    	end
    	print"bottom dialog ended"
    end
     
    local dialogBoxTween=GTween.new(dialog_Bottom, 1, {y = 530}, {delay = 0, ease = easing.outBack, onComplete = function() Core.asyncCall(sayDialogBottom, "Hi there, how are you?") end})
    after tween end, app crashes:
    [string "local function _start_(fn,...) coroutine.yield() fn(...) end return _start_(...)"]:1: attempt to call local 'fn' (a nil value)
    stack traceback:
    	[string "local function _start_(fn,...) coroutine.yield() fn(...) end return _start_(...)"]:1: in function <[string "local function _start_(fn,...) coroutine.yield() fn(...) end return _start_(...)"]:1>
    	(tail call): ?
    > 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
  • hgy29hgy29 Maintainer
    Yes, I agree the message isn’t very clear, a check for nil function passed in should be added to Core.asyncCall
  • Apollo14Apollo14 Member
    edited October 20
    Thx!
    There's one more little issue with asyncCalls (I've attached .gproj with reproduced issue).
    For some reason picture that is supposed to be shown (from async function), is shown with big delay when we use non-english characters.
    Is it a bug or an inevitable issue?
    ROBOTO_FONT @ \TTFont.new("Roboto-Regular.ttf",24)\
    local dialogBox, dialogText, delayedPic
     
    dialogBox=Bitmap.new(Texture.new("dialogBox.png",true))
    dialogBox:setPosition(20,40)
    stage:addChild(dialogBox)
     
    dialogText=TextField.new(ROBOTO_FONT, "")
    dialogText:setPosition(30,45)
    dialogBox:addChild(dialogText)
     
    delayedPic=Bitmap.new(Texture.new("calendar.png",true))
    delayedPic:setPosition(330,100)
    stage:addChild(delayedPic)
    delayedPic:setVisible(false)
     
    local function sayText(content)
    	for i=1, #content do
    		--if i==100 then delayedPic:setVisible(true) end	--though we expect it to be shown earlier, there's significant delay, it shows after all text is finished
    		Core.yield(0.03)
    		dialogText:setText(utf8.sub(content,1,i))
    	end
     
    	delayedPic:setVisible(true) --it is shown after significant delay
    end
     
    --[[ When we use english characters, pic appears without delay:
    Core.asyncCall(sayText,"Hello there,\nI'm testing delay.\nPic should appear\nimmediately after\ntext finished.")
    ]]
     
    -- With non-english characters there's delay:
    Core.asyncCall(sayText,"Привет,\nтестируем задержку\nкартинка появится\nсразу после\nокончания диалога.")
    zip
    zip
    testAsyncCallsDelay.zip
    106K
    > 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
  • hgy29hgy29 Maintainer
    Not sure if that's related, but you should use utf8.len(content) instead of #content in your sayText function

    Likes: Apollo14, talis

    +1 -1 (+2 / -0 ) Share on Facebook
  • Apollo14Apollo14 Member
    edited October 20
    hgy29 said:

    Not sure if that's related, but you should use utf8.len(content) instead of #content in your sayText function

    Wow! Now it works perfectly well, many thanks @hgy29 !
    What was happening there in the background, that created a delay?
    > 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
  • hgy29hgy29 Maintainer
    You were iterating over a lot more chars than your text was actually containing, adding several times your per-char delay in the end while not showing more characters...

    Likes: Apollo14, antix

    +1 -1 (+2 / -0 ) Share on Facebook
  • PaulRPaulR Member, Maintainer
    I don't know if anybody else agrees here, but I think concentrating all of these useful questions and answers in this thread reduces visibility/searchability for future users.

    I personally would prefer to see different questions in their own threads, so that answers and additional information is more visible. Plus concentrating everything in one thread leaves older threads on the front page, giving a 'dusty' look to the forum. :)
    +1 -1 (+2 / -0 ) Share on Facebook
  • PaulR said:

    I don't know if anybody else agrees here, but I think concentrating all of these useful questions and answers in this thread reduces visibility/searchability for future users.

    I personally would prefer to see different questions in their own threads, so that answers and additional information is more visible. Plus concentrating everything in one thread leaves older threads on the front page, giving a 'dusty' look to the forum. :)

    I agree, let's create separate topics when it's worth it.

    Likes: PaulR

    > 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
    +1 -1 (+1 / -0 ) Share on Facebook
  • Apollo14Apollo14 Member
    edited November 18
    guys @SinisterSoft @hgy29

    It seems that 'application:canOpenUrl("https://google.com")'
    always returns 'true', no matter what, even if I turn off internet connection

    does this call check only app permissions, if app is allowed to open any urls? or there's a bug?
    > 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
  • hgy29hgy29 Maintainer
    It supposed to check only app permissions, or rather to check if some application on your device can be used to display/open the specified url

    Likes: Apollo14

    +1 -1 (+1 / -0 ) Share on Facebook
Sign In or Register to comment.