PSP3D Left Header
PSP3D Header Right
PSP3D Logo CraveOnline Logo
Help the PSP 3D community grow!
Vote for us below:


Vote on the PSP Top 200
PSP Top 200 - Games, Videos, Wallpapers, Files, Hacks, Homebrew

Development Center - Learn the basics of coding or talk about advanced coding techniques with other developers.

Welcome to PSP3D.com - Sony PlayStation Portable News, Homebrew, Hacks, Reviews, Videos, Mods, Forums!

You are currently viewing our website as a guest, which gives you limited access to reply and interact to discussions and other members. By joining our free community, you will be able to post topics in the forums, communicate privately with other members, vote in polls, and access many other special features.

Registration is fast, simple, and absolutely free so join our community today!

Go Back PSP3D.com - Sony PlayStation Portable News, Homebrew, Hacks, Reviews, Videos, Mods, Forums > PSP Forums > Development Center
Tags: lua help


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-02-2007, 10:14 PM
Merick's Avatar
Merick Merick is offline
Member
My Mood:
 
Join Date: Feb 2007
Posts: 45
Points: 73.60
Donate
need help with a program

Gah, this is getting so frustrating! I'm trying to make a tile map editor. So far, I've got a start menu with options for new project and load project. The load project item isn't implemented yet, but for new project, I had integrated cancan's version of the danzeff osk to enter text for a project name, then create a new sub directory with that name. Up to that point, it was working fine, while testing I could go in, enter text, and the new directory would be created.

Then, I added in a tile loader function. The tile loader function appears to be working, but now the osk input for the project name isn't. I have no Idea what happened, I didn't change anything in the part of the code that calls up the osk. I've been looking at this for hours and I just can't figure out what's wrong

Code:
-- Lua Map Maker -- by Merick lum = Image.load("lum.png") hyperion = Font.load("hyperion.ttf") hyperion2 = Font.load("hyperion.ttf") hyperion:setPixelSizes(0, 20) hyperion2:setPixelSizes(43,50) red=Color.new(255,0,0) blue=Color.new(0,0,255) white=Color.new(255,255,255) dofile("danzeff.lua") keys = Danzeff:New() keys:Init(20, 20) menuitem = 1 tiles = {} tiles.pic = {} tiles.file = {} loop = true pname="" function title() -- display title screen screen:fontPrint(hyperion2,10,50,"Lu", red) x=hyperion2:getTextSize("Lu")["width"] screen:fontPrint(hyperion2,x+10,50, "a ",blue) x=hyperion2:getTextSize("Lua ")["width"] screen:fontPrint(hyperion2,x+10,50,"M", red) x=hyperion2:getTextSize("Lua M")["width"] screen:fontPrint(hyperion2,x+10,50, "ap ",blue) x=hyperion2:getTextSize("Lua Map ")["width"] screen:fontPrint(hyperion2,x+10,50,"M", red) x=hyperion2:getTextSize("Lua Map M")["width"] screen:fontPrint(hyperion2,x+10,50,"aker",blue) screen:blit(225, 122, lum) end function getpname() -- use osk to get name for new project while loop do screen:fontPrint(hyperion, 180, 20, "left trigger = numbers", white) screen:fontPrint(hyperion, 180, 50, "right trigger = shift", white) screen:fontPrint(hyperion, 180, 80, "D-pad up = backspace", white) screen:fontPrint(hyperion, 180, 110, "start = accept name", white) pad = Controls.read() newchar=keys:Input(pad) if newchar > 10 and newchar ~= oldchar then pname = pname .. string.char(newchar) end if newchar == 8 and newchar ~= oldchar then pname = string.sub(pname, 1, string.len(pname) - 1) end if newchar == 8 and newchar ~= oldchar then pname = string.sub(pname, 1, string.len(pname) - 1) end if newchar==4 then loop=false end if pname ~= nil then screen:fontPrint(hyperion, 20, 200, pname, white) end oldpad=pad oldchar=newchar keys:Display() screen:waitVblankStart() screen:flip() end screen:clear() screen:flip() end -- load all images from tiles folder function loadtiles() screen:clear() screen:fontPrint(hyperion, 100, 100, "loading tiles", red) screen:flip() local files = System.listDirectory("./tiles") for i = 3, table.getn(files) do tiles.pic[i-2] = Image.load("./tiles/"..files[i].name) tiles.file[i-2] = (files[i].name) end screen:fontPrint(hyperion, 100, 150, "done", blue) screen:flip() return end -- end of functions loadtiles() -- first menu screen while loop do screen:clear() title() if menuitem==1 then screen:fontPrint(hyperion, 10, 150,"Start New Project", red) else screen:fontPrint(hyperion, 10, 150,"Start New Project", white) end if menuitem==2 then screen:fontPrint(hyperion, 10, 180,"Load Project", red) else screen:fontPrint(hyperion, 10, 180,"Load Project", white) end pad = Controls.read() if pad:up() then menuitem=1 end if pad:down() then menuitem=2 end if pad:start() then loop=false end screen:waitVblankStart() screen:flip( ) end -- create new project folder if menuitem==1 then getpname() System.createDirectory(pname) pjdir = "./"..pname.."/" end loop=true while loop do pad = Controls.read() if pad:select() then loop=false end end
Doubleposted Message Below:
nvm, i figured out what was wrong
__________________

Last edited by Merick : 03-02-2007 at 10:14 PM. Reason: PSP3D.com Doublepost Preventer
Reply With Quote
Reply

« can you make a prx for me? | custom PRX »



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 0.00
Points Per Thread: 1.00
Points Per Reply: 0.10

Similar Threads
Thread Thread Starter Forum Replies Last Post
Subworld 34: Merry Xmas! theaceoffire Off Topic 11 12-17-2006 08:39 AM
Sony's PSP Programmer Tool Runtime Library Release 2.5.0 Sample Leak newser Homebrew/Hacking 5 09-18-2006 05:04 PM
best personalizing program pspkillsds Homebrew/Hacking 1 07-04-2006 12:48 AM
New L33t Program Static Off Topic 14 03-06-2006 06:26 PM
tv program for pc sikheadtom Off Topic 4 02-01-2006 03:17 PM





Crave Partner Sites: CraveOnline.com | DVDFile.com | PSP3D.com | ComingSoon.net | SuperHeroHype.com | RedBalcony.com | ActionTrip.com | CraveLyrics.com
Soundtrack.net | CraveFix.com | SpikedHumor.com | RPGamer.com | TattooNow.com | ImpactWrestling.com | SeekLyrics.com | PedalBMX.com | WildKO.com
vidKing.com | StrategyInformer.com | HHdb.com | RapLeagues.com | HipHop-Lyrics.com | Cravecocktails.com | ThePhatPhree.com | RideJudge.com | HottieSpots.com

ShopTapNham Shop Online Powered by Custom vB Version 5.1.0 for Crave Online Media, LLC.
Copyright © 2000 - 2007, Jelsoft Enterprises Ltd. and PSP3D.com.
LinkBacks Enabled by vBSEO 3.0.0 RC8

All times are GMT -4. The time now is 10:04 AM.
ShopTapNham Footer Right