| Autor |
Nachricht |
|
Simon
|
Verfasst: Mo Mai 14, 2007 6:14 pm |
|
| Mostly Harmless |
 |
Registriert: Mo Mär 12, 2007 8:19 pm Beiträge: 13
|
am having problems drawing a background on my game can anyone help me here the code
Code: procedure DoLoginScene; var d:TImageListItem; begin d := FrmMain.OImageList.ImageList.Items[1]; if d <> nil then d.Draw(10, 10, 0); // this is the part that dont work ... end;
thanks alot
|
|
| Nach oben |
|
 |
|
Firlefanz
|
Verfasst: Mo Mai 14, 2007 6:18 pm |
|
| Site Admin |
 |
 |
Registriert: Di Mai 04, 2004 9:48 am Beiträge: 4065 Wohnort: Drolshagen (Germany/NRW)
|
|
Hi Simon,
Is an image loaded (not black or something)?
Are tilewidth and tilesize correct?
Does this work:
FrmMain.OImageList.ImageList.Items[1].Draw(10, 10, 0);
Firle
_________________ You know you've spent too much time on the computer when you spill milk and the first thing you think is, 'edit, undo.'
|
|
| Nach oben |
|
 |
|
Simon
|
Betreff des Beitrags: ... Verfasst: Mo Mai 14, 2007 6:25 pm |
|
| Mostly Harmless |
 |
Registriert: Mo Mär 12, 2007 8:19 pm Beiträge: 13
|
nope I get error still
Exception:
------------------------------------------------------------------------------------
2.1 Date : Mon, 14 May 2007 17:24:55 +0100
2.2 Address: 0049D133
2.3 Module : RPGLegend.exe
2.4 Type : EAccessViolation
2.5 Message: Access violation at address 0049D133 in module 'RPGLegend.exe'. Read of address 00000030.
|
|
| Nach oben |
|
 |
|
Firlefanz
|
Verfasst: Mo Mai 14, 2007 6:27 pm |
|
| Site Admin |
 |
 |
Registriert: Di Mai 04, 2004 9:48 am Beiträge: 4065 Wohnort: Drolshagen (Germany/NRW)
|
Wasn't there something like a Imagelist.Init you need to call?
Is the image loaded, the screen component set in the imagelist?
Been a long timesI last worked with omega...
firle
_________________ You know you've spent too much time on the computer when you spill milk and the first thing you think is, 'edit, undo.'
|
|
| Nach oben |
|
 |
|
Simon
|
Verfasst: Mo Mai 14, 2007 6:48 pm |
|
| Mostly Harmless |
 |
Registriert: Mo Mär 12, 2007 8:19 pm Beiträge: 13
|
|
am trying to load a background image is that why?
size
H=768
W=1024
|
|
| Nach oben |
|
 |
|
Firlefanz
|
Verfasst: Mo Mai 14, 2007 6:49 pm |
|
| Site Admin |
 |
 |
Registriert: Di Mai 04, 2004 9:48 am Beiträge: 4065 Wohnort: Drolshagen (Germany/NRW)
|
|
Did you try OImageList.Init?
Maybe test the same with s smaller image to see if the code is correct?
Or test working code with this image here?
Firle
_________________ You know you've spent too much time on the computer when you spill milk and the first thing you think is, 'edit, undo.'
|
|
| Nach oben |
|
 |
|
Simon
|
Betreff des Beitrags: ... Verfasst: Mo Mai 14, 2007 6:53 pm |
|
| Mostly Harmless |
 |
Registriert: Mo Mär 12, 2007 8:19 pm Beiträge: 13
|
here the code
Code: procedure TFrmMain.FormCreate(Sender: TObject); begin //----------------------------------------------------- OScreen.Init; OImageList.Init; ClientWidth := SCREENWIDTH; ClientHeight := SCREENHEIGHT; OScreen.Width := ClientWidth; OScreen.Height := ClientHeight; //----------------------------------------------------- g_SoundMan := TSoundManager.Create; g_SoundMan.PlayBGM(bgm_intro, True); OTimer.Enabled := True; end;
TIMER Code: case g_State of eLogin: begin DoLoginScene; // login screen background end;
Scene Code: procedure DoLoginScene; var d:TImageListItem; begin d := FrmMain.OImageList.ImageList.Items[1]; if d <> nil then d.Draw(10, 10, 0); // this may work but tiles are worng maybe! end;
|
|
| Nach oben |
|
 |
|
Firlefanz
|
Verfasst: Mo Mai 14, 2007 7:16 pm |
|
| Site Admin |
 |
 |
Registriert: Di Mai 04, 2004 9:48 am Beiträge: 4065 Wohnort: Drolshagen (Germany/NRW)
|
|
Don't know.
Is it perhaps
d := FrmMain.OImageList.ImageList.Items[0];
or how many images did you load?
did you try drawing directly from the Imagelist like I said before?
Firle
_________________ You know you've spent too much time on the computer when you spill milk and the first thing you think is, 'edit, undo.'
|
|
| Nach oben |
|
 |
|
Simon
|
Verfasst: Mo Mai 14, 2007 7:27 pm |
|
| Mostly Harmless |
 |
Registriert: Mo Mär 12, 2007 8:19 pm Beiträge: 13
|
|
its loading just one background image
|
|
| Nach oben |
|
 |