Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 30

Thread: 3 little problems

  
  1. #1
    CT_Bolt's Avatar
    CT_Bolt is offline -Hacks Neophyte
    Join Date
    Jan 2006
    Location
    With the humans
    Posts
    54
    Rep Power
    14

    Default

    OK I need to know:
    1. How to make any *.Wav file play?
    I know how to add unmodified *.Wavs but, when I modify any(all different) of them i get an error.

    2. How to make a color in a BMP show up transparent with coding?

    3. What an array looks like in this?


  2. #2
    illfoundedmind is offline -Hacks Enthusiast
    Join Date
    Nov 2005
    Location
    WTF~~~~~~~~~~> Rank: %NULL
    Posts
    389
    Rep Power
    14

    Default

    1) files must be mono and cetrian specs.

    2) You mean when creating the file? If so BMP aren't transparent use PNG (graphicgale woul be a program to look into)

    3) a = { f = k, g = k }
    a.f = k

    Luaplayer.org
    july 19

  3. #3
    CT_Bolt's Avatar
    CT_Bolt is offline -Hacks Neophyte
    Join Date
    Jan 2006
    Location
    With the humans
    Posts
    54
    Rep Power
    14

    Default

    :D:D Thank you, this helps me alot.:D:D
    But, there isn't a way to specify a Transparent Color in Lua Script(not creating it, but thanx for the info).

    Umm... what exactly are you showing me in #3.

    Arrays(subscripts) I am used to look like ImgBoard(0),ImgBoard(1),ImgBoard(2),...
    This looks like types(properties). I'll try to understand with this though.

  4. #4
    modsyn is offline -Hacks Guru
    Join Date
    Aug 2005
    Location
    Shinigami Kurosaki Ichigo!
    Posts
    2,475
    Rep Power
    17

    Default

    lua uses tables. tables can look like arrays (java/c/c++ arrays) where you have

    Code:
    tab = {}
    tab[1] = "Index One"
    tab[2] = "Index Two"
    or you can define them using named indexes (rather than numbered indexes) like
    Code:
    tab = {}
    tab.one = "Index One"
    tab.two = "Index Two"
    tab is the variable name for a table variable. table values can be strings, numbers, or other tables.
    the following is the same as the second definition:
    Code:
    tab = { one= "Index One", two = "Index Two" }
    and for some very strange reason lua table indexes start at 1 instead of the usual 0 (like every other
    language that uses arrays)
    jMEnc Guide, jMEnc2 page - by the way, you smell nice

  5. #5
    illfoundedmind is offline -Hacks Enthusiast
    Join Date
    Nov 2005
    Location
    WTF~~~~~~~~~~> Rank: %NULL
    Posts
    389
    Rep Power
    14

    Default

    Quote Originally Posted by illfoundedmind
    that 1 thing pisses me off spent 1 hour debugging a app cuz that :(

    Quote Originally Posted by CT_Bolt
    :D:D Thank you, this helps me alot.:D:D
    But, there isn't a way to specify a Transparent Color in Lua Script(not creating it, but thanx for the info).
    I have the same question for the image.creation function is there a way to make the background transparent?

    Quote Originally Posted by CT_Bolt
    Umm... what exactly are you showing me in #3.

    Arrays(subscripts) I am used to look like ImgBoard(0),ImgBoard(1),ImgBoard(2),...
    This looks like types(properties). I'll try to understand with this though.
    I think modsyn answered your question for the last one.
    july 19

  6. #6
    modsyn is offline -Hacks Guru
    Join Date
    Aug 2005
    Location
    Shinigami Kurosaki Ichigo!
    Posts
    2,475
    Rep Power
    17

    Default

    look at the docs for screen:blit(), the last argument is an alpha level. you can set the transparency that way.
    i've never used it that way, though. i always just use precreated transparent pngs
    jMEnc Guide, jMEnc2 page - by the way, you smell nice

  7. #7
    illfoundedmind is offline -Hacks Enthusiast
    Join Date
    Nov 2005
    Location
    WTF~~~~~~~~~~> Rank: %NULL
    Posts
    389
    Rep Power
    14

    Default

    Thanks I did not know that. For the image creation function the default color is black which well doesn't work if you want to use layers. Thanks
    july 19

  8. #8
    CT_Bolt's Avatar
    CT_Bolt is offline -Hacks Neophyte
    Join Date
    Jan 2006
    Location
    With the humans
    Posts
    54
    Rep Power
    14

    Default

    :P:D Thank you all so much for your help. :D:P
    You both seem very understanding. :cool: I believe you have answered all my current questions.
    So... now of course... I have more for you:

    Q: How do you find a tables Lower and Upper Bounds?

    Q: Is it possible to loop through the table indexes?

    Q: Is this what it would look like?
    Code:
    for I = 1, 10 do
        tab[i] = "Index" + I
    end
    If it's not please correct me.:/

  9. #9
    modsyn is offline -Hacks Guru
    Join Date
    Aug 2005
    Location
    Shinigami Kurosaki Ichigo!
    Posts
    2,475
    Rep Power
    17

    Default

    somewhat, i would use
    Code:
    for i=1,table.getn(tab) do
        tab[i] = "Index " .. i
    end
    .. is string concatenation (not +, that will get you an error)
    jMEnc Guide, jMEnc2 page - by the way, you smell nice

  10. #10
    CT_Bolt's Avatar
    CT_Bolt is offline -Hacks Neophyte
    Join Date
    Jan 2006
    Location
    With the humans
    Posts
    54
    Rep Power
    14

    Default

    Wow you have been so helpful. :D Thank you so much. :D :mrgreen:
    You get credit in my Lua Apps. ;) :)
    Along with every one else that has helped me. Also when my beta versions are ready then you can test them if you want. :cool:

Page 1 of 3 1 2 3 LastLast

Posting Permissions

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