Seite 228 von 342 ErsteErste ... 128 178 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 278 328 ... LetzteLetzte
Zeige Ergebnis 6.811 bis 6.840 von 10238

Lua Programming Help Thread

This is a discussion on Lua Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; can anyone tell me how to draw circle?...

  
  1. #6811
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    can anyone tell me how to draw circle?



  2. #6812
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    yes, this came up a while back:
    Code:
    function drawCirc(where, x, y, radius, color)
    
    	theta = 0
    
    	while theta<=360 do
    		where:drawLine((math.sin(    theta)*radius)+x, (math.cos(theta)*radius)+    y, (math.sin(theta+1)*radius    )+x, (math.cos(theta+1)*radius    )+y, color)
    		theta = theta+1
    	end
    end

  3. #6813
    Points: 24.247, Level: 94
    Level completed: 90%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    texas
    Beiträge
    2.803
    Points
    24.247
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von emericaska8r
    yes, this came up a while back:
    Code:
    function drawCirc(where, x, y, radius, color)
    
    	theta = 0
    
    	while theta<=360 do
    		where:drawLine((math.sin(    theta)*radius)+x, (math.cos(theta)*radius)+    y, (math.sin(theta+1)*radius    )+x, (math.cos(theta+1)*radius    )+y, color)
    		theta = theta+1
    	end
    end
    Sigh..idiot...sin and cos are in RADIANS not DEGREES.
    牧来栠摩琠敨映汩獥
    PSN: youresam
    From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
    --Mike Hollingsworth

  4. #6814
    QJ Gamer Blue
    Points: 5.344, Level: 46
    Level completed: 97%, Points required for next Level: 6
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    347
    Points
    5.344
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    I have tryed a few things for the battery then searched for some tutorials but didn't find anything anyone know of a tutorial?

  5. #6815
    QJ Gamer Blue
    Points: 4.349, Level: 41
    Level completed: 99%, Points required for next Level: 1
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Upstate, NY USA
    Beiträge
    121
    Points
    4.349
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    What are the number codes for wait time with

    screen.waitVblankStart()

    Sorry for such a n00b question, but I'm just getting into all this. :)
    Thanks in advance for the kind help.

  6. #6816
    Points: 24.247, Level: 94
    Level completed: 90%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    texas
    Beiträge
    2.803
    Points
    24.247
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Bob Hoil
    I have tryed a few things for the battery then searched for some tutorials but didn't find anything anyone know of a tutorial?
    Yeah, I found a great one before: http://www.ies.co.jp/math/java/samples/sinBox.html
    牧来栠摩琠敨映汩獥
    PSN: youresam
    From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
    --Mike Hollingsworth

  7. #6817
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    youresam - Not everyone is a know-it-all like you.

    Bob Hoil - 'for the battery' means what? Get its voltage, its temperature, its battery life in time, battery life in percent, etc.

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  8. #6818
    Points: 24.247, Level: 94
    Level completed: 90%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    texas
    Beiträge
    2.803
    Points
    24.247
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    youresam - Not everyone is a know-it-all like you.
    Its called using sine.
    牧来栠摩琠敨映汩獥
    PSN: youresam
    From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
    --Mike Hollingsworth

  9. #6819
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    youresam - Not everyone is a know-it-all like you.
    thanks :Punk:

  10. #6820
    QJ Gamer Blue
    Points: 4.349, Level: 41
    Level completed: 99%, Points required for next Level: 1
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Upstate, NY USA
    Beiträge
    121
    Points
    4.349
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Anyone care to help me with my question?

  11. #6821
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von psp phd
    What are the number codes for wait time with

    screen.waitVblankStart()

    Sorry for such a n00b question, but I'm just getting into all this. :)
    Thanks in advance for the kind help.
    let me see, i'm not completely sure what you mean, but the numbers you can put in the screen.waitVblankStart() will tell the psp how much milliseconds to wait.

  12. #6822
    Points: 24.247, Level: 94
    Level completed: 90%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    texas
    Beiträge
    2.803
    Points
    24.247
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von emericaska8r
    let me see, i'm not completely sure what you mean, but the numbers you can put in the screen.waitVblankStart() will tell the psp how much milliseconds to wait.
    No, thats System.sleep().
    screen.waitVblankStart() is 1/60 of a second, and Shine added a parameter to run that function x times.
    牧来栠摩琠敨映汩獥
    PSN: youresam
    From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
    --Mike Hollingsworth

  13. #6823
    Developer
    Points: 4.318, Level: 41
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    205
    Points
    4.318
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von yumCOOKIEZZ
    It said line 54 and...that was line 54 o.o
    pad = Controls.read()

    I get an error "Attempt to index global 'controls' (a nil value)"


    This tells me differently. A capital C is correct, and the error was from having a lowercase c.




    Zitat Zitat von emericaska8r
    let me see, i'm not completely sure what you mean, but the numbers you can put in the screen.waitVblankStart() will tell the psp how much milliseconds to wait.
    Not quite... screen.waitVblankStart(60 ) is one second. The command means something like "wait for vertical sync" or something (not sure about the exact terminology), which occurs 60 times per second on the PSP (60 Hz). I just know the screen can only update once every 1/60th of a second.

    EDIT: youresam beat me to it, but I added more info.

  14. #6824
    Points: 24.247, Level: 94
    Level completed: 90%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    texas
    Beiträge
    2.803
    Points
    24.247
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von LMelior
    The command means something like "wait for vertical sync" or something (not sure about the exact terminology), which occurs 60 times per second on the PSP (60 Hz).
    Its an old term from CRTs that would wait for the next vertical blank before redrawing to the screen.

    Zitat Zitat von LMelior
    I just know the screen can only update once every 1/60th of a second.
    With screen.waitVblankStart(), yes. But without it, I've pulled off 1500 frames per second (no thats not a typo) with luaplayer.
    牧来栠摩琠敨映汩獥
    PSN: youresam
    From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
    --Mike Hollingsworth

  15. #6825
    QJ Gamer Blue
    Points: 3.525, Level: 37
    Level completed: 17%, Points required for next Level: 125
    Overall activity: 0%

    Registriert seit
    Apr 2007
    Beiträge
    81
    Points
    3.525
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard

    O noes. I new error =(

    Image.load: Error loading image.



    Any help?

  16. #6826
    QJ Gamer Gold
    Points: 11.942, Level: 71
    Level completed: 73%, Points required for next Level: 108
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Ort
    ...
    Beiträge
    2.080
    Points
    11.942
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    you didnt load the image right

  17. #6827
    QJ Gamer Blue
    Points: 5.344, Level: 46
    Level completed: 97%, Points required for next Level: 6
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    347
    Points
    5.344
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    I meant i want to make one that looks like the one on the xmb. I want the battery shape. Thanks BobHoil

  18. #6828
    QJ Gamer Blue
    Points: 4.349, Level: 41
    Level completed: 99%, Points required for next Level: 1
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Upstate, NY USA
    Beiträge
    121
    Points
    4.349
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Thanks for the help guys. I work full time, but have been working on Lua as a hobby. :)
    (I've been on the PSP scene almost since the start.)
    This is very exciting. I'll see you guys around the forums :)

  19. #6829
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von youresam
    Its an old term from CRTs that would wait for the next vertical blank before redrawing to the screen.


    With screen.waitVblankStart(), yes. But without it, I've pulled off 1500 frames per second (no thats not a typo) with luaplayer.
    Wow.

    Anyways, Would you be able to edit lua player to allow a 1080x1080 picture to be loaded and blited to screen without taking all the memory? Or will memory be a issue?

  20. #6830
    QJ Gamer Blue
    Points: 3.525, Level: 37
    Level completed: 17%, Points required for next Level: 125
    Overall activity: 0%

    Registriert seit
    Apr 2007
    Beiträge
    81
    Points
    3.525
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Urameshi
    you didnt load the image right
    but what isn't right about it?

    logo = Image.load("Images/logo.jpg")

    I have logo.jpg stored in the Images folder.

  21. #6831
    QJ Gamer Gold
    Points: 11.942, Level: 71
    Level completed: 73%, Points required for next Level: 108
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Ort
    ...
    Beiträge
    2.080
    Points
    11.942
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    logo=Image.load("./Images/logo.jpg")

  22. #6832
    QJ Gamer Blue
    Points: 3.525, Level: 37
    Level completed: 17%, Points required for next Level: 125
    Overall activity: 0%

    Registriert seit
    Apr 2007
    Beiträge
    81
    Points
    3.525
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard

    Same Error =(

    I'm gonna try it with a different image and see what happens.

  23. #6833
    QJ Gamer Gold
    Points: 11.942, Level: 71
    Level completed: 73%, Points required for next Level: 108
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Ort
    ...
    Beiträge
    2.080
    Points
    11.942
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    why dont you just post your code?

  24. #6834
    QJ Gamer Blue
    Points: 3.525, Level: 37
    Level completed: 17%, Points required for next Level: 125
    Overall activity: 0%

    Registriert seit
    Apr 2007
    Beiträge
    81
    Points
    3.525
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard

    I tried a different image and it worked.

    Does size have anything to do with image loading? It isn't a big picture but when I switched to the 'Powered by Lua' image it worked fine.

    I guess Lua just doesn't like the windows vista logo.

  25. #6835
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von youresam
    No, thats System.sleep().
    screen.waitVblankStart() is 1/60 of a second, and Shine added a parameter to run that function x times.
    whoops :Argh:

  26. #6836
    QJ Gamer Gold
    Points: 11.942, Level: 71
    Level completed: 73%, Points required for next Level: 108
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Ort
    ...
    Beiträge
    2.080
    Points
    11.942
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    well i know that the picture cant be like over 500x500

  27. #6837
    QJ Gamer Blue
    Points: 3.525, Level: 37
    Level completed: 17%, Points required for next Level: 125
    Overall activity: 0%

    Registriert seit
    Apr 2007
    Beiträge
    81
    Points
    3.525
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard

    How do I make an image appear transparent? I want one image on top on another but I don't want all of the white around it.

  28. #6838
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    change the alpha value of the image. (0 being clear, 255 being opaque)

  29. #6839
    QJ Gamer Blue
    Points: 3.768, Level: 38
    Level completed: 79%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Apr 2007
    Beiträge
    70
    Points
    3.768
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    hii there people...
    i have to ask..
    is there a way to blit a lightblend image... if soo how ?
    is there a way to texture lightblend in gu ... is soo how ?
    thanks in advance.

  30. #6840
    Points: 24.247, Level: 94
    Level completed: 90%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    texas
    Beiträge
    2.803
    Points
    24.247
    Level
    94
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von ahrimanes
    hii there people...
    i have to ask..
    is there a way to blit a lightblend image... if soo how ?
    is there a way to texture lightblend in gu ... is soo how ?
    thanks in advance.
    No.
    Set the texture mode to Gu.TFX_MODULATE, it basically caps the colors at the defined RGBA color. (So for 100 transparency do Color.new(255,255,255,100 ))
    -= Double Post =-
    Zitat Zitat von yumCOOKIEZZ
    I tried a different image and it worked.

    Does size have anything to do with image loading? It isn't a big picture but when I switched to the 'Powered by Lua' image it worked fine.

    I guess Lua just doesn't like the windows vista logo.
    Yeah, thats probably it.
    Geändert von youresam (04-16-2007 um 06:13 PM Uhr) Grund: Automerged Doublepost
    牧来栠摩琠敨映汩獥
    PSN: youresam
    From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
    --Mike Hollingsworth


 

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 07:54 AM Uhr.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © , Caputo Media, LLC. All Rights Reserved. Cluster .