Level director tutorials

Yes, thank you.

Only thing is that the SIM doesn’t go in Landscape mode.
I’m sure I’ll figure it out, I don’t want to bother you with everything.

Thanks mate!

2 more question’s

I’m trying to make something myself of the " PottyBird " Project.

I see when I’m looking trough the PottyBird project, that the “Crabs” are in the object class Enemie.
How do you make a object class ? 

I also tried adding the bird in my project, all the pictures and the XML are in my /Images folder.
But when I try it in the simulator the bird doesn’t appear ?

I’m feeling I’m getting a hang of this, only got these questions.

Thanks again!

To setup class names, go to tools->options->project

Here you will see a grid where you can type your class names.

Against the asset properties you will then see a dropdown list containing your newly added class names.

Each instance of an object will then inherit this class, you can override it though.

The bird was created using Texturepacker, did you import it via the xml file and placed the first frame on the canvas?

Yes, I imported it via the XML file, and I placed the bird on the screen.

Edit:

Got it to work!

Excellent, what was the problem?

I don’t know what the problem was.

I simply just deleted the bird, and placed it on the canvas again!

I’m also trying to get the screen to scroll as on the " PottyBird " example.

I’m guessing this is the code : 
 

local function move (event)

   myLevel:move(3.0,0)

   end

   

   Runtime:addEventListener( “enterFrame”, move )

When I write that in Main.Lua nothing really happens ? 

and one more question, If I want something like " flappybird " when I tap the screen the bird goes up.

Do I write code in " Level01.lua" or do I write the code in Main.lua ? 

Thanks

For scrolling, you need to enable it first on the level.

Click on the level (grey margins) to see the level properties and set ‘ParallaxEnabled’ = true

Then click on the layers you want to scroll and set the Parallax speeds e.g. 1.0

Once exported the move function should work.

Also note if you want the layers/objects to wrap you must have images across at least 2 screen widths so they can wrap onto the offscreen portion.

Load the PottyBird example in LD to see how it was done.

All your user coding should go in main.lua or sub modules, not your exported LD file as this is always replaced when exported.

To add a tap listener, simply get a local copy of your bird and add the listener e.g.

local bird = myLevel:getLayerObject("layer1","bird").view local function moveBird(event) end

Runtime:addEventListener(“tap”, moveBird)

You just need to add code in the moveBird function based on the event.x and y values.

Hope this helps.

I’ve been trying to do this " tap " function, I don’t really understand.

 

local bird = myLevel:getLayerObject("layer1","bird").view

“layer1”   I’m guessing I have to change that, because my bird is in a layer called " bird " ?

 

local function moveBird(event) myLevel:moveBird(x.y) end Runtime:addEventListener("tap",moveBird)

am I on the wrong track here or ?

Yes the layer will need be the name of the layer the bird is on.

In the function moveBird you need to write your own code to move the bird using the bird object.

e.g.

bird.x = event.x bird.y = event.y

I suggest looking at some basic examples that come with Corona to see how events work and how you can apply them to your needs as you’ll probably want to move you bird only by the delta moved.

When I put a BG picture in the LD canvas, and open the SIM. The BG is completely out of " order " 
It’s not in the middle of the screen, If I put it way out of the LD canvas, it’s suddenly correct in the SIM.

Have you experienced that ?

This can happen if there is a mismatch between the target size in LD and the target size in your config.lua file.

You also may experience problems if the width and height are the wrong way round in your config file.

The width and height should always be specified in portrait mode, if you want landscape then you specify this in your build settings.

Hope this helps.

I’m also getting a error when i try to quit LD, I think this came when I downloaded 2.7

I can’t quit the software, maybe it’s something wrong with my PC. But it’s kinda weird

I’ve tried reinstaling the program, but it doesn’t fix it.

 

Se slutten av denne meldingen for detaljert informasjon om aktivering av JIT-feilsøking (Just In Time) i stedet for denne dialogboksen. \*\*\*\*\*\*\*\*\*\*\*\*\*\* Unntakstekst \*\*\*\*\*\*\*\*\*\*\*\*\*\* System.UnauthorizedAccessException: Ingen tilgang til banen C:\Program Files (x86)\Retrofit Productions\Level Director\Level Director.mru. ved System.IO.\_\_Error.WinIOError(Int32 errorCode, String maybeFullPath) ved System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY\_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) ved System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) ved System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) ved System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize) ved System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding) ved System.IO.File.AppendAllText(String path, String contents, Encoding encoding) ved Director.Settings.SaveMRU() ved Director.frmDirector.frmDirector\_FormClosing(Object sender, FormClosingEventArgs e) ved System.Windows.Forms.Form.WmClose(Message& m) ved System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) ved System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) \*\*\*\*\*\*\*\*\*\*\*\*\*\* Innlastede samlinger \*\*\*\*\*\*\*\*\*\*\*\*\*\* mscorlib Samlingsversjon: 2.0.0.0 Win32-versjon: 2.0.50727.5477 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll ---------------------------------------- mscorlib.resources Samlingsversjon: 2.0.0.0 Win32-versjon: 2.0.50727.5477 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll ---------------------------------------- Level Director Samlingsversjon: 2.7.0.25628 Win32-versjon: 2.7.0 CodeBase: file:///C:/Program%20Files%20(x86)/Retrofit%20Productions/Level%20Director/Level%20Director.exe ---------------------------------------- Microsoft.VisualBasic Samlingsversjon: 8.0.0.0 Win32-versjon: 8.0.50727.5420 (Win7SP1.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC\_MSIL/Microsoft.VisualBasic/8.0.0.0\_\_b03f5f7f11d50a3a/Microsoft.VisualBasic.dll ---------------------------------------- System Samlingsversjon: 2.0.0.0 Win32-versjon: 2.0.50727.5467 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC\_MSIL/System/2.0.0.0\_\_b77a5c561934e089/System.dll ---------------------------------------- System.Windows.Forms Samlingsversjon: 2.0.0.0 Win32-versjon: 2.0.50727.5468 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC\_MSIL/System.Windows.Forms/2.0.0.0\_\_b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System.Drawing Samlingsversjon: 2.0.0.0 Win32-versjon: 2.0.50727.5467 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC\_MSIL/System.Drawing/2.0.0.0\_\_b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System.Runtime.Remoting Samlingsversjon: 2.0.0.0 Win32-versjon: 2.0.50727.5420 (Win7SP1.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC\_MSIL/System.Runtime.Remoting/2.0.0.0\_\_b77a5c561934e089/System.Runtime.Remoting.dll ---------------------------------------- System.Windows.Forms.resources Samlingsversjon: 2.0.0.0 Win32-versjon: 2.0.50727.5420 (Win7SP1.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC\_MSIL/System.Windows.Forms.resources/2.0.0.0\_no\_b77a5c561934e089/System.Windows.Forms.resources.dll ---------------------------------------- Aga.Controls Samlingsversjon: 1.0.0.0 Win32-versjon: 1.0.0.0 CodeBase: file:///C:/Program%20Files%20(x86)/Retrofit%20Productions/Level%20Director/Aga.Controls.DLL ---------------------------------------- PropertyGridEx Samlingsversjon: 1.0.0.0 Win32-versjon: 1.0.0.0 CodeBase: file:///C:/Program%20Files%20(x86)/Retrofit%20Productions/Level%20Director/PropertyGridEx.DLL ---------------------------------------- Curves Samlingsversjon: 1.0.0.0 Win32-versjon: 1.0.0.0 CodeBase: file:///C:/Program%20Files%20(x86)/Retrofit%20Productions/Level%20Director/Curves.DLL ---------------------------------------- System.Xml Samlingsversjon: 2.0.0.0 Win32-versjon: 2.0.50727.5476 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC\_MSIL/System.Xml/2.0.0.0\_\_b77a5c561934e089/System.Xml.dll ---------------------------------------- System.Configuration Samlingsversjon: 2.0.0.0 Win32-versjon: 2.0.50727.5476 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC\_MSIL/System.Configuration/2.0.0.0\_\_b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- System.Data Samlingsversjon: 2.0.0.0 Win32-versjon: 2.0.50727.5420 (Win7SP1.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC\_64/System.Data/2.0.0.0\_\_b77a5c561934e089/System.Data.dll ---------------------------------------- System.Design Samlingsversjon: 2.0.0.0 Win32-versjon: 2.0.50727.5468 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC\_MSIL/System.Design/2.0.0.0\_\_b03f5f7f11d50a3a/System.Design.dll ---------------------------------------- System.resources Samlingsversjon: 2.0.0.0 Win32-versjon: 2.0.50727.5420 (Win7SP1.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC\_MSIL/System.resources/2.0.0.0\_no\_b77a5c561934e089/System.resources.dll ---------------------------------------- System.Drawing.Design Samlingsversjon: 2.0.0.0 Win32-versjon: 2.0.50727.4927 (NetFXspW7.050727-4900) CodeBase: file:///C:/Windows/assembly/GAC\_MSIL/System.Drawing.Design/2.0.0.0\_\_b03f5f7f11d50a3a/System.Drawing.Design.dll ---------------------------------------- -sj5wulh Samlingsversjon: 2.7.0.25628 Win32-versjon: 2.0.50727.5467 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC\_MSIL/System/2.0.0.0\_\_b77a5c561934e089/System.dll ---------------------------------------- v4gpcr8s Samlingsversjon: 2.7.0.25628 Win32-versjon: 2.0.50727.5467 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC\_MSIL/System/2.0.0.0\_\_b77a5c561934e089/System.dll ---------------------------------------- XPClient Samlingsversjon: 3.0.0.30552 Win32-versjon: 3.0.96.0 CodeBase: file:///C:/Program%20Files%20(x86)/ASUS/ASUS%20WebStorage/3.0.108.222/XPClient.DLL ---------------------------------------- LogicNP.EZNamespaceExtensions Samlingsversjon: 4.0.0.0 Win32-versjon: 4.0.0.0 CodeBase: file:///C:/Program%20Files%20(x86)/ASUS/ASUS%20WebStorage/3.0.108.222/LogicNP.EZNamespaceExtensions.DLL ---------------------------------------- eCaremeDLL Samlingsversjon: 1.0.0.0 Win32-versjon: 1.0.0.0 CodeBase: file:///C:/Program%20Files%20(x86)/ASUS/ASUS%20WebStorage/3.0.108.222/eCaremeDLL.DLL ---------------------------------------- log4net Samlingsversjon: 1.2.10.0 Win32-versjon: 1.2.10.0 CodeBase: file:///C:/Program%20Files%20(x86)/ASUS/ASUS%20WebStorage/3.0.108.222/log4net.DLL ---------------------------------------- Accessibility Samlingsversjon: 2.0.0.0 Win32-versjon: 2.0.50727.4927 (NetFXspW7.050727-4900) CodeBase: file:///C:/Windows/assembly/GAC\_MSIL/Accessibility/2.0.0.0\_\_b03f5f7f11d50a3a/Accessibility.dll ---------------------------------------- \*\*\*\*\*\*\*\*\*\*\*\*\*\* JIT-feilsøking \*\*\*\*\*\*\*\*\*\*\*\*\*\* Når du skal aktivere JIT-feilsøking (Just In Time), må .config-filen for dette programmet eller datamaskinen (machine.config) ha jitDebugging-verdien angitt i delen system.windows.forms. Programmet må også kompileres med feilsøking aktivert. For eksempel: \<configuration\> \<system.windows.forms jitDebugging="true" /\> \</configuration\> Når JIT-feilsøking er aktivert, blir alle ubehandlede unntak sendt til JIT-feilsøkingen som er registrert på datamaskinen, i stedet for å bli behandlet av denne dialogboksen.

It’s in Norwegian, Have no Idea what it means.

Its trying to write a file to store your last opened files.

Can you try running LD in Administrator mode to see if it resolves it (right click on icon and click ‘Run as Administrator’) ?

Did you figure out the problem with the BG appearing in the wrong position?

I’m reinstalling it again, I’ll try to run it as Admin.

I haven’t really tried, because of that error bugging me! I’ll see if it works fine now.

Running as Admin seemed to fix the problem.
Still having troubles with this background thing.

I tried changing W/H several times in Config etc etc

zvsb5s.png

Great.

In your config the width and height are wrong, they need to be switched.

To show it landscape modify your build.settings file to include something like this

settings = { orientation = { default = 'landscapeRight', supported = {'landscapeLeft', 'landscapeRight'}, }, }

Also, do you have any code in you main.lua that is manipulating the objects?

I tried switching it, but it doesn’t work.

 

display.setStatusBar( display.HiddenStatusBar ) local LD = require("lib.LD\_LoaderG2") physics = require ("physics") physics.start() local myLevel = {} myLevel = LD:loadLevel('Level01') myLevel:initLevel () --local function move(event) -- myLevel:move(3.0,0) --end --Runtime:addEventListener( "enterFrame", move )

That is my main.Lua

Please could you zip up your project and email it to me (support @ retrofitproductions.com) so I can take a look for you.

Done!