Question about rtg displaying graphics

Moderators: Der Wanderer, Blackbird

Question about rtg displaying graphics

Postby A500 » 14. January 2018, 01:35

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.
A500
Newbie
 
Posts: 40
Joined: 6. October 2013, 06:44

Re: Question about rtg displaying graphics

Postby HelmutH » 17. January 2018, 17:20

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)
Gruß Helmut
User avatar
HelmutH
User
 
Posts: 96
Joined: 8. October 2013, 20:28

Re: Question about rtg displaying graphics

Postby asrael » 18. January 2018, 08:57

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
asrael
Newbie
 
Posts: 21
Joined: 15. October 2015, 09:21

Re: Question about rtg displaying graphics

Postby Daedalus » 21. January 2018, 20:33

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.
User avatar
Daedalus
Newbie
 
Posts: 42
Joined: 12. May 2014, 23:11
Location: Glasgow, Scotland

Re: Question about rtg displaying graphics

Postby hackball » 10. February 2018, 01:20

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.
Amiga. Just to let ya know....
User avatar
hackball
Master
 
Posts: 112
Joined: 1. September 2013, 20:21

Re: Question about rtg displaying graphics

Postby hackball » 10. February 2018, 20:25

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. ;)
Amiga. Just to let ya know....
User avatar
hackball
Master
 
Posts: 112
Joined: 1. September 2013, 20:21


Return to Questions & Answers

Who is online

Users browsing this forum: No registered users and 2 guests

cron