Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: megane on March 28, 2010, 07:23:17 PM

Title: i cant upload image to scene
Post by: megane on March 28, 2010, 07:23:17 PM

Hello,


i created a scene and i want to upload a background image this. but i am taking some errors..

CBImage::CreateTexture tile at 0,7 no texture set ..
CBSurfaceD3D:CreateEmptyTexture error creating an empty texture.
error gettting texture ...
..
...
..


help me, please



Best Regards.
Title: Re: i cant upload image to scene
Post by: Mnemonic on March 28, 2010, 08:10:04 PM
Can you post the entire log?
Also, how big is the image? Seems like you're trying to use some super-large image.
Title: Re: i cant upload image to scene
Post by: megane on March 28, 2010, 08:32:06 PM

yeah some big image.but it is ok. i uploaded.
now i want to control my background image by keyboard.
i wrote these codes under the scene_init.script. but it doesnt work..


Code: [Select]
#include "scripts\base.inc"

// here comes the stuff which initializes the scene





////////////////////////////////////////////////////////////////////////////////
// scene state
global Statepanoroma;


// default values
if(Statepanoroma==null)
{
  Statepanoroma.Visited = false;
  // add scene states here
    if (Keyboard.KeyCode == "VK_UP")
{
      Scene.SkipTo(Scene.X, Scene.Y-50);
}
else if (Keyboard.KeyCode == "VK_DOWN")
{
      Scene.SkipTo(Scene.X, Scene.Y+50);
}
else if (Keyboard.KeyCode == "VK_LEFT")
{
      Scene.SkipTo(500, 300);//Scene.SkipTo(Scene.X-50, Scene.Y);
}
else if (Keyboard.KeyCode == "VK_RIGHT")
{
      Scene.SkipTo(Scene.X+50, Scene.Y);
}
}



////////////////////////////////////////////////////////////////////////////////
// setup scene according to state variables



////////////////////////////////////////////////////////////////////////////////
if(!Statepanoroma.Visited)
{
  Statepanoroma.Visited = true;

  // this is our first visit in this scene...
 


}

Title: Re: i cant upload image to scene
Post by: metamorphium on March 28, 2010, 09:31:35 PM
first of all you are missing this include at the top:

#include "scripts\keys.inc"

secondly remove parenthesis from VK codes


example: if (Keyboard.KeyCode == VK_UP)

thirdly you're putting your code to entirely wrong place.

place all your keyboard handling into

on "Keypress"
{

}

block and then modify your game.script to read something like this:

Code: WME Script
  1. on "Keypress"
  2. {
  3.     if (Scene.CanHandleEvent("Keypress")) Scene.ApplyEvent("Keypress");
  4.  
  5.    // the rest of your original handler here
  6. }
  7.  
  8.  
Title: Re: i cant upload image to scene
Post by: megane on March 28, 2010, 10:07:24 PM


Really thanks, i am asking so easy question...i know... but i am so new and i havent time...

Now .i am wrote these codes under the scene_init.script  and  myscene.script.i tried both.but it doesnt work :(



Code: [Select]
#include "scripts\keys.inc"

on "Keypress"
{
   if (Scene.CanHandleEvent("Keypress")) Scene.ApplyEvent("Keypress");
 
  if (Keyboard.KeyCode == VK_UP)
{
      Scene.SkipTo(Scene.X, Scene.Y-50);
}
else if (Keyboard.KeyCode == VK_DOWN)
{
      Scene.SkipTo(Scene.X, Scene.Y+50);
}
else if (Keyboard.KeyCode == VK_LEFT)
{
      Scene.SkipTo(Scene.X-50, Scene.Y);
}
else if (Keyboard.KeyCode == VK_RIGHT)
{
      Scene.SkipTo(Scene.X+50, Scene.Y);
}


}
Title: Re: i cant upload image to scene
Post by: metamorphium on March 28, 2010, 11:41:06 PM
megane, please read my post carefully. Especially the block which goes into your game.script file (in the scripts folder).
Title: Re: i cant upload image to scene
Post by: megane on March 29, 2010, 07:14:32 PM


Thank you so much. it is ok now. but i have another problem :)
i try to do a panoroma..you know.. and my image has width=wdith= 17845,  height=1791.
And i cant set my scene 's main layer's width . because integer can be 10000.
What should i do this stuation ?



Best Regards.
Title: Re: i cant upload image to scene
Post by: Nihil on March 29, 2010, 08:17:48 PM
You could use 2 pictures. But generally I don't think it's a good idea to use such freakin huge images at all.