Deprecated: Assigning the return value of new by reference is deprecated in /var/www/psdevWiki/inc/parserutils.php on line 161

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/psdevWiki/inc/parserutils.php on line 164

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/psdevWiki/inc/parserutils.php on line 294

Deprecated: Function split() is deprecated in /var/www/psdevWiki/inc/auth.php on line 97

Warning: Cannot modify header information - headers already sent by (output started at /var/www/psdevWiki/inc/parserutils.php:161) in /var/www/psdevWiki/inc/auth.php on line 180

Deprecated: Function split() is deprecated in /var/www/psdevWiki/inc/common.php on line 552

Warning: Cannot modify header information - headers already sent by (output started at /var/www/psdevWiki/inc/parserutils.php:161) in /var/www/psdevWiki/inc/actions.php on line 71
psp:lua_player:library:romero126:draw:textbox [psDevWiki]
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PST/-8.0/no DST' instead in /var/www/psdevWiki/inc/template.php on line 154
 

Draw a Textbox No borders

nil Draw:TextBox(x, y, text, width, height, color, offsetx, offsety)
local function Draw:TextBox(x, y, text, width, height, color, offsetx, offsety)
	local x = x or error("number expected got ".. type(x), 1)
	local y = y or error("number expected got ".. type(x), 1)
	local text = text or error("[string or table] expected got ".. type(x), 1)
	local width = width or error("number expected got ".. type(x), 1)
	
	if (type(text) == "string") then
		text = { text } 
	end
 
	local width = width or (480 - x)
	local height = height or (272 - y)
	local color = color or Color.new(255,255,255)
	local offsetx = offsetx or 0 -- Change offset X to something
	local offsety = offsety or 1 -- Change offset Y to something
 
	local MaxLines = math.floor((height -8) / 8 )
	local Padding = math.floor(((height- 8)-(MaxLines*8))/2)
	local MaxLetters = math.floor( width / (480/59))
 
	for i = 0, MaxLines do
		value = text[offsety + i]
		if (value ~= "") and (value) then
			value = string.sub(value, offsetx, offsetx+MaxLetters)
		end
		if (value ~= "") and (value) then
			screen:print(x + 5, y+Padding+(i*8), value, color)
		end
	end
	return MaxLines, MaxLetters
end
 

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PST/-8.0/no DST' instead in /var/www/psdevWiki/inc/template.php on line 523
psp/lua_player/library/romero126/draw/textbox.txt · Last modified: 2008/05/15 00:07
 
Recent changes RSS feed Creative Commons License Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki