This project is read-only.

Loading textures

Nov 20, 2012 at 12:27 PM

Hi, i just started using Nine engine and i am running in a small problem but i cant seem to solve it.

I have the following code in my Game1 class :

scene = Content.Load("MyScene");

but i am getting a error :

Error loading "MyScene". File contains Microsoft.Xna.Framework.Graphics.Texture2D but trying to load as Nine.Graphics.Heightmap.

in my xaml file i have a surface with a heightmap

I dont know why i am getting this error.

Thx in advance

Nov 20, 2012 at 1:08 PM

Have you set the processor of the heightmap texture to use "Heightmap - Engine Nine" ?

Or did you set the processor of the scene to use "Content - Engine Nine" ?

Nov 20, 2012 at 4:30 PM

I had set the processor for the xaml file to Content - Engine Nine. But now if i set the processor to Heightmap - Engine Nine i get a error that 

scene = Content.Load("MyScene");  cant find MyScene file.
Nov 20, 2012 at 4:38 PM
Edited Nov 20, 2012 at 4:45 PM

From what I know Load needs type of T to load a content.

scene = Content.Load<Scene>("MyScene");

But you get the error message "cant find MyScene file." ?

One thing you can have missed is the Root Directory can be wrong, but I wouldn't guess so.


yufeih could it be, that the Content is not set to use Nine Content Loader? ( this should be set before 'RootDirectory' is set )

Content = new ContentLoader(Services);
Nov 20, 2012 at 9:22 PM

I now know what i did wrong. I did not set the property of my heightmap file (heightmap.bmp) to processor heightmap -Engine Nine.

Thank you still for the quick reply and help.