Page 5 of 7 FirstFirst 1234567 LastLast
Results 41 to 50 of 63

Thread: can somebody please tell me what I'm doing wrong with my lua script?

                  
   
  1. #41
    DCEmu Reviewer Shadowblind's Avatar
    Join Date
    Apr 2006
    Location
    PR:SB End
    Posts
    3,796
    Rep Power
    115

    Default

    Here, uase tables:

    card_1 = {
    Image.load("card1.png"),
    Image.load("card2.png"),
    Image.load("card3.png"),
    Image.load("card4.png"),
    Image.load("card5.png"),
    Image.load("card6.png"),
    Image.load("card7.png"),
    Image.load("card8.png"),
    }

    This is a more suitable way to upload images. Less memory leaks

  2. #42
    DCEmu Coder lmtlmt's Avatar
    Join Date
    Jan 2006
    Location
    Brisbane, Australia
    Posts
    1,755
    Rep Power
    92

    Default

    oh sorry it didnt work because i didnt change it from

    card.png to SDY-001.jpg

    I'll try it again

  3. #43
    DCEmu Reviewer Shadowblind's Avatar
    Join Date
    Apr 2006
    Location
    PR:SB End
    Posts
    3,796
    Rep Power
    115

    Default

    Thats for loading the into animation i beleive...

    This would be for images I think

    Cards = { }
    card[1] =Image.load("card.png")
    card[2] = Image.load("card3.png")
    card[3] = Image.load("card4.png")
    card[4] = Image.load("card5.png")
    card[5] = Image.load("card6.png")


    Im not what you'd call experiance, so maybe check with zion or yaustar first.

  4. #44
    DCEmu Coder lmtlmt's Avatar
    Join Date
    Jan 2006
    Location
    Brisbane, Australia
    Posts
    1,755
    Rep Power
    92

    Default

    nope stilll didnt work
    thanx for trying

  5. #45

  6. #46
    DCEmu Coder lmtlmt's Avatar
    Join Date
    Jan 2006
    Location
    Brisbane, Australia
    Posts
    1,755
    Rep Power
    92

    Default

    i tried to register but it kept saying
    text written is not the same as shown
    in the part how you have to write what it says RU5SD, that thing

  7. #47

  8. #48
    GP2X Coder/Moderator
    Join Date
    Jan 2006
    Posts
    1,678
    Rep Power
    87

    Default

    Quote Originally Posted by lmtlmt
    i was trying to make the selecter move from one space to another by pressing left.
    it doesnt work. here is the script



    any ideas on how to make it work
    Here is your mistake:
    screen:blit(384, 172, selecter)
    if pad:left() then
    selecter.x = selecter.x - 78
    Here you attempt to create an entry in a table on a variable that is not a table. Also there is no end for your if statement.

    Try this:
    green = Color.new(0, 255, 0)
    blue = Color.new(0, 128, 255)
    luaLogo = Image.load("deck.jpg")
    background = Image.load("YUGI BACKGROUND2.png")
    lifepoints = (4000)
    selecter = Image.load("selecter.png")

    function scaleImage(newX, newY, theImage)

    resizedImage = Image.createEmpty(newX, newY)
    for x = 1, newX do
    for y = 1, newY do
    resizedImage:blit(x,y , theImage,
    math.floor(x*(theImage:width()/newX)),math.floor(y*(theImage:height()/newY)), 1,
    1)
    end
    end
    return resizedImage

    end

    scaleImage(53,70, luaLogo) -- Resize image.

    selectorX = 384

    while true do
    pad = controls.read()
    screen:blit(0, 0, background, false)
    screen:blit(2,173, resizedImage) -- Show the resized image
    screen:print(10, 11, "player 1 its your turn", green)
    screen:print(410, 14, lifepoints, blue)
    screen:blit(selectorX, 172, selecter)
    if pad:left() then
    selectorX = selectorX - 78
    end

    screen.flip()
    screen.waitVblankStart()

    end
    Quote Originally Posted by lmtlmt
    could somebody post i list of all the lua symbols you know

    ==
    =~

    and all thier meanings?
    http://lua-users.org/wiki/ExpressionsTutorial

  9. #49
    DCEmu Coder lmtlmt's Avatar
    Join Date
    Jan 2006
    Location
    Brisbane, Australia
    Posts
    1,755
    Rep Power
    92

    Default

    thanx yaustar, but it doesnt work

  10. #50
    GP2X Coder/Moderator
    Join Date
    Jan 2006
    Posts
    1,678
    Rep Power
    87

    Default

    Quote Originally Posted by lmtlmt
    thanx yaustar, but it doesnt work
    That doesn't tell me much. WHAT doesn't work.

Page 5 of 7 FirstFirst 1234567 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •