Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
problem misaligned textures when duplicates - Gideros Forum

problem misaligned textures when duplicates

MoKaLuxMoKaLux Member
edited May 2019 in General questions
Hello there,

I have a problem with my code. Everything is ok when I do not have duplicate references.

When I do this it works:
Arabic_Words.new(2, 27, 2, 0, 1, 23, 2, 28, 3, nil, nil, nil, nil, nil, nil,"d", "m", "mf", ":", "md", "md", "m", "m", "f", nil, nil, nil, nil, nil, nil,"a", "s", "oun", ":", "a", "s", "a", "s", "ou", nil, nil, nil, nil, nil, nil),
But when I do this it doesn't work:
Arabic_Words.new(2, 28, 3, 0, 1, 23, 2, 28, 3, nil, nil, nil, nil, nil, nil,"d", "m", "mf", ":", "md", "md", "m", "m", "f", nil, nil, nil, nil, nil, nil,"a", "s", "oun", ":", "a", "s", "a", "s", "ou", nil, nil, nil, nil, nil, nil),
You can see that I have duplicate: 2, 28, 3, 0, 1, 23, 2, 28, 3

On the screenshot, I can see that the first duplicate is not in the right position, it is drawn over! Please note that this is right to left but I don't know if that matters as this is only textures not real text!?




Some more info:



You can see that the textures have been moved over.

I simply loop through some tables and set the textures positions. I guess this is something to do with table references (index) but that shouldn't happen.

I cannot find where in my code the problem is, could somebody have a look when you have time?

Thank you in advance. Peace.
gideros_error_img.png
482 x 852 - 14K
zip
zip
mkgiArab.zip
50K
gideros_error_img2.png
482 x 852 - 12K

Comments

  • MoKaLuxMoKaLux Member
    edited May 2019
    I have now installed ZBS for debugging but it doesn't stop on my break point!

    I have copied mobdebug to my project then clicked exclude from execution.

    Then in my main at the top I have:
    io.stdout:setvbuf('no')
    --if arg[#arg] == "-debug" then require("mobdebug").start() end
    require("mobdebug").start()
    I have no errors but it doesn't stop on my break point.

    Does ZBS debug work only for the game loop?
  • MoKaLuxMoKaLux Member
    @keszegh thank you, I did not know you wrote this zbs tutorial. In fact, after installing zbs I read your tutorial and the debugging code for zbs is from your tutorial.
  • MoKaLuxMoKaLux Member
    I tried but the debugger doesn't stop on my break point! The program runs fine but I cannot debug it!
  • Why do you want Zerobrane Studio?
    We have debugger now in Gideros.
    > 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)
  • MoKaLuxMoKaLux Member
    I have tried debugging in both, but the debugger won't stop at the line where I have put the mark. It is in the load function so it gets executed before being debugged!

    Could you tell me what you think may be the cause of my bug? It happens only when I have duplicate so maybe that's an index thing in a table?
  • hgy29hgy29 Maintainer
    Accepted Answer
    @MoKaLux, by the look of your issue, and further confirmed by reading your code, it seems that you create only one Sprite for each letter (except vowels), so you can't have more than one copy of each on screen.

    Fix option #1: create multiple sprites
    . remove line 16 and assign arabletter to arabletters_list entry on line 17
    . return Bitmap.new(xlf) on line 110

    Fix option #2: create views of your sprites
    . change line 110 to local v=Viewport.new() v:setContent(xlf) return v

    Likes: MoKaLux

    +1 -1 (+1 / -0 ) Share on Facebook
  • MoKaLuxMoKaLux Member
    edited May 2019
    @hgy29 the BOSS has spoken! thank you very much, I am going to change that code!

    youpi :smile:

    I used your fix number 2 and it works like a charm. Thank you very much for your kind help.

    Likes: Apollo14, hgy29

    +1 -1 (+2 / -0 ) Share on Facebook
  • MoKaLuxMoKaLux Member
    edited May 2019
    now my gideros player keeps crashing! I tried ZBS, I messed up with debugging, ... now every time I click CTRL+R in gideros studio to test the app, the gideros player crashes!!!
  • antixantix Member
    Does it crash when running one of the examples that come with Gideros?
  • MoKaLuxMoKaLux Member
    @antix hello there, I have uninstalled/reinstalled gideros and now everything is fine again. Thank you.

    PS: i won't touch zbs again!

    Likes: MoKaLux, SinisterSoft

    Dislikes: keszegh

    +1 -1 (+2 / -1 ) Share on Facebook
  • antixantix Member
    Interesting, ZBS by its self would not cause the player to crash like that. I'll always use ZBS as I think it has the edge over Gideros Studio ;)
Sign In or Register to comment.