if you look at the evil mana tut its not as easy as just changing some xy positions
he has it set up diferent
Printable View
if you look at the evil mana tut its not as easy as just changing some xy positions
he has it set up diferent
Sorry i dont have time to read all of your code but do you have a Controls.read(); at all to intialize the buttons?Zitat:
Zitat von Gonrai
Edit: nvm found it
size is 450kb...its like 15-20 secs long.Zitat:
Zitat von JoeDaStudd
can someone pleas post a snippet to find ur current FPS???
I wanted to add a typewriter effect but I get an error.
Code:-- EVILMANA.COM PSP LUA CODEBASE
-- www.evilmana.com/tutorials/codebase
-- Typewriter Effect for Text
-- SUBMITTED BY: dennis van den broek
-- Code : DS (dialogue system)
-- Autor: Dennis van den broek
white = Color.new(255, 255, 255)
-- initialise if the DS (dialogue system) should be called
DS_set = 0
-- strings used for the effect
DS_str = { }
DS_str[1] = "This is a typewriter machine test..."
DS_str[2] = "This code is a test which can be used freely,"
DS_str[3] = "in any type of game, credits are allways welcome"
-- temp string that stores the current to write string
write_str = ""
str_length = 0
-- counter for holding where on the string we are
i = 1
num = 1
-- sets the DS on or off
function init_DS(type)
if type == 1 then
DS_set = 1
else
DS_set = 0
num = 1
end
end
-- checks what string to write, function should be upgraded with detection of which
string to print
-- currently it's a simple placeholding code
function set_DS()
if num > 3 then
init_DS(0)
end
Typewriter(DS_str[num], 2, 10, 100)
end
-- the actual code, input the string you wanna print, and how many characters per
frame you wanna show up...
function Typewriter(str, speed, DSx, DSy)
read_str = str
str_length = string.len(read_str)
if i <= str_length then
i = i+speed
write_str = string.sub(read_str, 1, i)
screen:print(DSx, DSy, write_str, white)
else
screen:print(DSx, DSy, write_str, white)
if pad:cross() and oldpad:cross() ~= pad:cross() then
i = 0
num = num + 1
end
end
end
-- main while loop
while true do
pad = Controls.read()
if pad:cross() and oldpad:cross() ~= pad:cross() then
init_DS(1)
end
if DS_set == 1 then
set_DS()
end
screen.waitVblankStart()
screen.flip()
screen:clear()
oldpad = pad
end
how about you post the error... Why wouldnt you saying you need help?
And I dont have time to read through the code and see whats wrong, even with an the error, but I can say having any 'screen' calls after you flip the display buffer is pointless. remove the screen:clear, it has no effect.
I get this error.
Code:Error: index.lua:38 /=/ expected near /to/
Well, go to line 38, see if there is something there that shouldnt be... Looks to me that the comment got brought out of the -- segment, making an error... Simply add '--' before 'string' on line 38.
And on all of the other lines where comments are.
Ok I got it to work. Now If I want to exit my program, do I just inputCode:if pad:start() then
exit