Page 1 of 1

Question about rtg displaying graphics

PostPosted: 14. January 2018, 01:35
by A500
Heydraw t
I saw a tutorial about displaying rtg graphics like an example down below:

XINCLUDE "dbl_display.include.ab3"

succ.l = image_load {2, gfxpath.s+"glass_big", $FF00FF,20}: imagemidhandle{2}

and so on.


I understand there is no video tutorial or excellent book I can read to get me to understand the dbl_display.include.ab3 and I am in my own to learn from these example source codes. Which I am ok with. The reason i am posting here is this. If I want to draw a picture of a hero animated in four direction, a wall of four different sides and a gem and that is that, can I just draw them in normal png with 32 x 32 as each side and that is about it or can I draw them in a sheet and just extract them from a sheet? If I can get it from a single sheet is there a tutorial to show me how to do this in rtg mode (not custom chipset) or is there a tutorial in how to load single sprite by sprite of size 32 x 32 from separate file? thanks.

Re: Question about rtg displaying graphics

PostPosted: 17. January 2018, 17:20
by HelmutH
Hey A500
Great that you do something with AmiBlitz³.
Unfortunately, I can not help you with your question, because I understand too little of AmiBlitz.
Unfortunately it is also the case that Thilo (The Wanderer), (Blackbird) and also all those who took care of the further development, do not report any more here. Also write on multiple direct, no one reports more of those. Too bad that nobody thinks it necessary to write here exactly what is going on. I see the AmiBlitz project as death, so I can only advise you to look for another programming language to continue building your project. A good would be there Hollywood, with which you can create versions for all operating systems.

AmigaOS 3 (m68k)
AmigaOS 4 (ppc)
Android (arm)
AROS (x86)
iOS (arm)
Linux (x86)
Linux (x64)
Linux (arm)
Linux (ppc)
Mac OS X (x86)
Mac OS X (x64)
Mac OS X (ppc)
MorphOS (ppc)
WarpOS (m68k/ppc)
Windows (x86)
Windows (x64)

Re: Question about rtg displaying graphics

PostPosted: 18. January 2018, 08:57
by asrael
Or just use BlitzBasic.

There is a forum section at eab where you might still get help as there are still a lot of BlitzBasic/AmiBlitz developers out there:
http://eab.abime.net/forumdisplay.php?f=126



Cheers,
Manfred

Re: Question about rtg displaying graphics

PostPosted: 21. January 2018, 20:33
by Daedalus
Yeah, unfortunately there doesn't seem to be much appetite for further development of AmiBlitz, though in its current state it is very useful.

As for the question, the dbl_display include doesn't really deal with images in that way, you really need to be using the image.include as well. This contains functions for manipulating images, including the image_cut{} function. This can be used to create a new image from part of an existing image, so if you have a single bitmap with all your images in blocks, simply use For...Next loops and the image_cut{} function to create individual 32x32 bitmaps of your shapes.

Re: Question about rtg displaying graphics

PostPosted: 10. February 2018, 01:20
by hackball
Please don't promote anybody here to Hollywood.

I'll try to relocate some code to give an example, but, normally, coding requires reading. the given task is no problem at all if someone is familar with the language.

Re: Question about rtg displaying graphics

PostPosted: 10. February 2018, 20:25
by hackball
Here it is.
I simply cut this from AmegaOne src. I hope you see how this works.

(code)
Select enemyID
Case #ENEMY_TANK1
EnemyL()\img = #IMG_TANK1
EnemyL()\frame = 0
EnemyL()\width = image_GetWidth {imgA(EnemyL()\img)} / 16 ;16 is the number of animframes
EnemyL()\height = image_GetHeight{imgA(EnemyL()\img)}

...


ResetList EnemyL()
While NextItem(EnemyL())
...
x.l = Int(EnemyL()\x)-\mapPosX-EnemyL()\width/2
y.l = Int(EnemyL()\y)-\mapPosY-EnemyL()\height/2
image_SetBlitDims{imgA(EnemyL()\img),EnemyL()\width*Int(EnemyL()\frame),0,EnemyL()\width,EnemyL()\height}
dbl_QBlit{imgA(EnemyL()\img),x,y}
EndIf
Wend
(/code)

what it does is:
the gfx of an enemy in this case is one wide spritesheet with all frames after each other.
the width of each frame is Getwidth{...} / numframes.
later, when blitting, the actual frame gets picked with
SetBlitDims{imageid, framewidth * frame,...}
so that the frame is a multiplier to set the x-offset inside the wide spritesheet.

Is that easy to understand? i hope it is. ;)

Re: Question about rtg displaying graphics

PostPosted: 24. March 2018, 22:22
by hackball
No comments on this? Any success?