Code: Select all
Program New;
Var
MainForm : TSTForm;
Image : TSTImage;
Quit : Integer;
Procedure FormClose(Sender: TObject; var Action : TCloseAction);
Begin
a.Free();
raiseException(erCustomError,'User Input on GUI. Script Stop!');
Quit := 1;
End;
Begin
Quit := 0;
MainForm := TSTForm.Create; // This will create the form to start work on it.
MainForm.OnClose := @FormClose; // This will be function called when you close then Form window
MainForm.Width := 400; // This will set the Form width
MainForm.Height := 200; // This will set the Form height
MainForm.caption := 'Hello'; // This will be the name that will appear on top of Form, in the blue bar
MainForm.Color := clBtnFace; // This will set the color of the Window
MainForm.BorderStyle := bsSingle; // This will set the style of Window
MainForm.Visible := True; // This will make the Window be visible
MainForm.Show; // This will show the Window
// Now the part that get the item image from art.mul
Image := TSTImage.Create(MainForm); // This will create the image on the 'MainForm' Form
Image.Left := 50; // This will set the position from left of 'MainForm' Window
Image.Top := 50; // This will set the position from top of 'MainForm' Window
Image.AutoSize := True; // This will make the image autosize
Image.Transparent := True; // This will remove the white background from the image
Image.Center := True; // This will center the image
Image.Picture.Bitmap := GetStaticArt($2F59,$0000); // This will store and show the bitmap of item type $2F59 and color $0000, you can 'paint' the picture just changing the hue in the GetStaticArt function.
While Quit <> 1 Do
Wait(200);
End.