Seite 199 von 342 ErsteErste ... 99 149 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 249 299 ... LetzteLetzte
Zeige Ergebnis 5.941 bis 5.970 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; Zitat von Merick can anyone point me to some code that can rotate an image? With or without the GU?...

  
  1. #5941
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Merick
    can anyone point me to some code that can rotate an image?
    With or without the GU?



  2. #5942
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    hmm...

    well, right now my program is only using 2d, I haven't even looked at the 3d GU yet, but if the GU can be combined with my 2d stuff without problems, and if it works better than a 2d function would....

    Basically, I'm making a tile map editor and I'd like to be able to rotate the tile images by 1/4, 1/2, and 3/4 turns

  3. #5943
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    gu works better than any other way. but i dont know if it will cooperate with your 2d stuff easily

  4. #5944
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Doing it without the GU is (very?) slow but still possible.

    This will help: http://forums.qj.net/f-psp-developme...lua-98105.html

  5. #5945
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    thanks, I will eventually be looking into the gu, but for now it looks like this will do what I need

  6. #5946
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Round a number:
    Code:
    function roundnum(roundnum_num)
    return math.floor(roundnum_num+0.5)
    end
    Or just use

    Code:
    math.floor(number+0.5)

  7. #5947
    Points: 3.458, Level: 36
    Level completed: 72%, Points required for next Level: 42
    Overall activity: 16,0%

    Registriert seit
    Jan 2007
    Beiträge
    6
    Points
    3.458
    Level
    36
    Downloads
    0
    Uploads
    0

    Standard

    hii all,
    I want to copy a file, but i don't know how...
    It shoud work like when you are in level 5 of my game a photo need to be copied
    to the photo map

  8. #5948
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Sulfer, do you mean like copy a file that's already on your memcard, or do you want to make a screenshot or something?

  9. #5949
    Points: 8.718, Level: 62
    Level completed: 90%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Beiträge
    484
    Points
    8.718
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Hey in netlib you need netget(id)? Becuase i looked at some online games and they dont use netget when reciing from yourgame_room..room_numbe r. They just netrecv() and netvalue, so I took out netget from the example and it didn't work?? Is there a reason for this.

  10. #5950
    Points: 3.458, Level: 36
    Level completed: 72%, Points required for next Level: 42
    Overall activity: 16,0%

    Registriert seit
    Jan 2007
    Beiträge
    6
    Points
    3.458
    Level
    36
    Downloads
    0
    Uploads
    0

    Standard

    @Merick, i want copy file's that are already on my memstick, could you help me whit that? thx
    (ps don't flame me for my english :o )

  11. #5951
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    6ft. Down Underground........Oh and guess what my avatar is
    Beiträge
    387
    Points
    4.918
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Is it possible to disable a button in lua?....like lets say the "home" button. if so how

  12. #5952
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    this will copy a file:

    Code:
    file = io.open("filename.ext","r")
    filecopy = file:read("*a")
    file:close()
    
    copiedfile = io.open("newfile.ext", "w")
    copiedfile:write(filecopy)
    copiedfile:close()

  13. #5953
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    6ft. Down Underground........Oh and guess what my avatar is
    Beiträge
    387
    Points
    4.918
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    wont that just copy whats in a file and paste it in a already created file?

  14. #5954
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    only if "newfile.ext" already exists. If you use the io.open and write commands with a filename for a file that doesn't exist, then it will create a new file with that name to write to

  15. #5955
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von the undead
    Is it possible to disable a button in lua?....like lets say the "home" button. if so how
    No, there is not. If you would like to disable people from using the HOME button, modify the LuaPlayer src to disable the callbacks. Takes about 5 seconds.

  16. #5956
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Well, I have successfully integrated KleptoOne's image rotate function into my prog. It works fine, except that the rotated images it produces end up a bit distorted. It'll do for now but eventually I'll need to find a better way.

  17. #5957
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    6ft. Down Underground........Oh and guess what my avatar is
    Beiträge
    387
    Points
    4.918
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Access_Denied
    No, there is not. If you would like to disable people from using the HOME button, modify the LuaPlayer src to disable the callbacks. Takes about 5 seconds.
    ok, so do i need to install psptoolchain and cgwin or w/e?

  18. #5958
    Developer
    Points: 4.205, Level: 41
    Level completed: 28%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    San Diego
    Beiträge
    177
    Points
    4.205
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Merick
    Well, I have successfully integrated KleptoOne's image rotate function into my prog. It works fine, except that the rotated images it produces end up a bit distorted. It'll do for now but eventually I'll need to find a better way.
    I found out the best way is to use the GU. what you do is draw four triangles with starting points in the center forming a square. Then you texture your image over it and modify the z value to change its size and (depending on how you drew the triangles) modify the roll to rotate. If you want some sample code, let me know.

  19. #5959
    QJ Gamer Blue
    Points: 5.034, Level: 45
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    243
    Points
    5.034
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    2 triangles would be easier, or one rectangle.
    and using gu over top of the rest of your game is kind of a bad idea, make it all gu rendered or none of it gu rendered.

  20. #5960
    Ponies and Unicorns
    Points: 5.778, Level: 49
    Level completed: 14%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Pelennor Fields
    Beiträge
    547
    Points
    5.778
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von the undead
    ok, so do i need to install psptoolchain and cgwin or w/e?
    Well yah because you would need to recompile it after you disables the callbacks.
    If you play WoW come find me on DOOMHAMMER (US) I am Human mage lvl 64 Atrana is the name (dont ask for runs!)
    Gold donations are highly appreciated!

  21. #5961
    Developer
    Points: 4.205, Level: 41
    Level completed: 28%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    San Diego
    Beiträge
    177
    Points
    4.205
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von eyece
    2 triangles would be easier, or one rectangle.
    and using gu over top of the rest of your game is kind of a bad idea, make it all gu rendered or none of it gu rendered.
    I found that 2 triangles rotates the image at the corner rather than the center. Is it just the way I drew the triangles that gives me that glitch? Also how do you draw rectangles in lua?

  22. #5962
    QJ Gamer Blue
    Points: 5.034, Level: 45
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    243
    Points
    5.034
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    its how to have positioned the texture, it should be in the center.
    (middleOfSquare - (widthOfTexture / 2)) basically

  23. #5963
    QJ Gamer Blue
    Points: 5.303, Level: 46
    Level completed: 77%, Points required for next Level: 47
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Beiträge
    219
    Points
    5.303
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    Can someone tell me what the exact .WAV audio support is for LUA?

  24. #5964
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Seeing as I haven't even looked at the GU yet, I'm not even sure how I would convert my current tile drawing routines to use it. On the other hand, If i could use the GU to blit a rotated image to the screen and then use a screen capture function to save it as a regular 2d image in my tile array, then that should be pretty easy to combine with what I already have

  25. #5965
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    6ft. Down Underground........Oh and guess what my avatar is
    Beiträge
    387
    Points
    4.918
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Can u open up a prx in lua and change a specific part of the code?

  26. #5966
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    right guys another day, another question. Im still not sure if im doing the right thing. Right im using scanf to remember the letters that i enter but here's my problem when scaning for an integer you just do int NAME OF VARIABLE;
    what would you enter for a string ?

  27. #5967
    Points: 3.458, Level: 36
    Level completed: 72%, Points required for next Level: 42
    Overall activity: 16,0%

    Registriert seit
    Jan 2007
    Beiträge
    6
    Points
    3.458
    Level
    36
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Merick
    this will copy a file:

    Code:
    file = io.open("filename.ext","r")
    filecopy = file:read("*a")
    file:close()
    
    copiedfile = io.open("newfile.ext", "w")
    copiedfile:write(filecopy)
    copiedfile:close()
    thx for the help, but how can you define wher it's need to be copied?

  28. #5968
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Just put in the name of the folder where you want it to go:

    "./folder name/filename.ext"

  29. #5969
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    6ft. Down Underground........Oh and guess what my avatar is
    Beiträge
    387
    Points
    4.918
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    y doesnt this work?....it doesnt write to the file, or print it
    here is my code
    Code:
    irsignal = nil
    System.irdaInit()
    
    while true do
    pad = Controls.read()
    screen:clear()
    if irsignal == nil then
    irsignal = System.irdaRead()
    end
    if irsignal ~= nil then
    screen:print(10, 10, irsignal)
    end
    if pad:cross() then
    copiedfile = io.open("remote.txt", "w")
    copiedfile:write(irsignal)
    copiedfile:close()
    end
    screen.flip()
    end

  30. #5970
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    I don't really know anything about using the irda, but are you sure that you've got the sensor lined up properly with whatever device you're trying to read from?


 

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:53 AM Uhr.

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