DSLua Community
Welcome, Guest. Please login or register.
May 18, 2012, 09:15:35 PM
1371 Posts in 262 Topics by 33109 Members
Latest Member: Limewire Download
DSLua Community  |  DSLua - Best scripting language for Nintendo DS  |  Need Help?  |  Ummm... « previous next »
Pages: [1]
Author Topic: Ummm...  (Read 1413 times)
LeightonW87
Waxing Crescent
**
Posts: 17


« on: July 17, 2006, 05:50:04 PM »

Hi, I'm new here Cheesy and thought I would like to try DSLua but I'm fairly new, I know the basics for programming but Lua is a bit confusing, could someone tell me why this does not work and is the a site with tutorials and docs on DSLua other that here??? Huh

Code:
-- setting backgrounds up

--
BGTOPTEXT = Screen.LoadTextBG()
--
BGTOP8BIT = Screen.Load8BitBG()

-- INIT TOP SCREEN
Screen.Initialize( 1, BGTOPTEXT, BGTOP8BIT )

-- SETTING COLOUR OF TEXT TO GREEN
TextBackGround:«»SetPaletteColor( 150, 0, 150, 0 )

-- print text to screen
TextBackGround:«»PrintXY ( 1, 1, "This is a TEST, TEST TEST TEST..." )
DSLua.WaitForAnyKey()
Logged
daltonlaffs
First Quarter
***
Posts: 189


Freaking Insane


WWW
« Reply #1 on: July 17, 2006, 06:58:07 PM »

Well, first of all, no, this is the only documentations so far. But there are some in production!

AND as for the code, Â, «, and » do not work in DSLua, as it does not know how to handle them. Try somethin else without any foreign characters.

Also, waruwaru correct me if I'm wrong, I'm pretty sure you can't initialize the same screen with TWO Initiatives (8bit and Text) Try with just text and maybe it'll work.

Here, have a cookie. Did I say cookie? I meant a fixed version by me and tested by me:

SCREEN_BOTTOM = 0
SCREEN_TOP = 1
-- setting backgrounds up

--
BGTOPTEXT = Screen.LoadTextBG()

-- INIT TOP SCREEN
Screen.Initialize( SCREEN_TOP, BGTOPTEXT )
-- SET DA COLOR 2 YELLAH!!!
BGTOPTEXT:SetColor( 150, 0, 150, 0 )
-- print text to screen
BGTOPTEXT:PrintXY ( 0, 1, "This is a TEST!" )
BGTOPTEXT:PrintXY ( 0, 2, "Modded by Daltonlaffs Tongue" )
DSLua.WaitForAnyKey()
Logged

Code:
-- Bored? Read code line below.
-- Bored? Read code line above.



^^ That works, I SWEAR! ^^
LeightonW87
Waxing Crescent
**
Posts: 17


« Reply #2 on: July 18, 2006, 12:21:35 PM »

The only reason I had Â, «, and » in the code is because one of the tutorials had it in the code, I think it was the background tutorial that had it.

Thanks anyway Cheesy, umm...
also could someone tell me how do I add 8bit backgrounds using 8bit BMPs??? Smiley
Logged
daltonlaffs
First Quarter
***
Posts: 189


Freaking Insane


WWW
« Reply #3 on: July 18, 2006, 06:10:54 PM »

could someone tell me how do I add 8bit backgrounds using 8bit BMPs??? Smiley

Aaaaaactually... I don't use those, nor do I understand em. Angor? Zhen? Ohr Gmbh? Waruwaru? Anyone?!
Logged

Code:
-- Bored? Read code line below.
-- Bored? Read code line above.



^^ That works, I SWEAR! ^^
Zhen
Waxing Crescent
**
Posts: 45


WWW
« Reply #4 on: July 19, 2006, 04:06:39 AM »

could someone tell me how do I add 8bit backgrounds using 8bit BMPs??? Smiley

The first version will work, you can initialize two planes (one for text and another for pixels, bitmaps )

Code:
SCREEN_BOTTOM = 0
SCREEN_TOP = 1
-- setting backgrounds up
BGTOPTEXT = Screen.LoadTextBG()
BGTOPBMP = Screen.Load8BitBG()

-- INIT TOP SCREEN
Screen.Initialize( SCREEN_TOP, BGTOPTEXT, BGTOPBMP )

-- SET DA COLOR 2 YELLAH!!!
BGTOPTEXT:SetColor( 150, 0, 150, 0 )
-- print text to screen
BGTOPTEXT:PrintXY ( 0, 1, "This is a TEST!" )
BGTOPTEXT:PrintXY ( 0, 2, "Modded by Daltonlaffs Tongue. And Zhen." )

-- draw a line
local colour = 1
BGTOPBMP::SetPaletteColor( colour, 31, 31, 31 )
BGTOPBMP:Line( 10, 10, 150, 130, colour )

DSLua.WaitForAnyKey()

The order of backgrounds in the Initialize function is the order front-rear in the screen. or vicerveza.

Try this, Zhen
Logged
Pages: [1]
« previous next »
    Jump to: