Aktuelle Zeit: So Mai 19, 2013 8:51 pm


Neues Thema erstellenAntwort erstellen Seite 1 von 1   [ 9 Beiträge ]
Autor Nachricht
 Betreff des Beitrags: Problems with draw funcation
BeitragVerfasst: Mo Mai 14, 2007 6:14 pm 
Mostly Harmless
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
 Profil  
 
 Betreff des Beitrags:
BeitragVerfasst: Mo Mai 14, 2007 6:18 pm 
Site Admin
Site Admin
Benutzeravatar

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
 Profil  
 
 Betreff des Beitrags: ...
BeitragVerfasst: Mo Mai 14, 2007 6:25 pm 
Mostly Harmless
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
 Profil  
 
 Betreff des Beitrags:
BeitragVerfasst: Mo Mai 14, 2007 6:27 pm 
Site Admin
Site Admin
Benutzeravatar

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... :D

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
 Profil  
 
 Betreff des Beitrags: ..
BeitragVerfasst: Mo Mai 14, 2007 6:48 pm 
Mostly Harmless
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
 Profil  
 
 Betreff des Beitrags:
BeitragVerfasst: Mo Mai 14, 2007 6:49 pm 
Site Admin
Site Admin
Benutzeravatar

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
 Profil  
 
 Betreff des Beitrags: ...
BeitragVerfasst: Mo Mai 14, 2007 6:53 pm 
Mostly Harmless
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
 Profil  
 
 Betreff des Beitrags:
BeitragVerfasst: Mo Mai 14, 2007 7:16 pm 
Site Admin
Site Admin
Benutzeravatar

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
 Profil  
 
 Betreff des Beitrags: ..
BeitragVerfasst: Mo Mai 14, 2007 7:27 pm 
Mostly Harmless
Mostly Harmless

Registriert: Mo Mär 12, 2007 8:19 pm
Beiträge: 13
its loading just one background image


Nach oben
 Profil  
 
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Neues Thema erstellenAntwort erstellen Seite 1 von 1   [ 9 Beiträge ]


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 0 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
cron


Powered by phpBB® Forum Software © phpBB Group
twilightBB Style by Daniel St. Jules of Gamexe.net

Deutsche Übersetzung durch phpBB.de