[Implemented] CreateSprite()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

[Implemented] CreateSprite()

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.



CreateSprite() and SpriteOutput()
would be fine, to use the 2D drawing
commands on sprites too.

Thanks,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
CreateSprite() and SpriteOutput()
would be fine, to use the 2D drawing
commands on sprites too.
SpriteOutput() already exists (according to the docs anyway, haven't checked it in code) which is another good reason for having a CreateSprite() :wink:

--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.20)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

You are right tinman.

I looked at StartDrawing() because i dont
have the time to read the whole manual every time.
Its logical to have all Output commands in the
help for StartDrawing(), but SpriteOutput() was
missing there.

Maybe Fred can add it to the DOCs.

So only CreateSprite(#Sprite, Width, Height [,Flag]) is needed...

cya,
...Danilo
(registered PureBasic user)

Edited by - Danilo on 30 June 2002 23:31:50
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

Fred, can you add this plz ??

cya,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Yes.

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by MrVainSCL.

Hi @ all
Until Fred will add this to one of the next versions... You can do something like following code example, i used in my 32k game too, to create and use own sprites Maybe this will help some of you for the first...

Code: Select all

;----------------------------------------
; Subroutine -> Create Your Sprite
;----------------------------------------
SUB_CreateYourSprite:
;
    StartDrawing(OutputID)                                 ; ### START DRAWING ### 
      ;
      ;==== Insert here your drawing stuff to paint the sprite ====
      ;
    StopDrawing()                                          ; ### STOP DRAWING ###
    ;
    GrabSprite(#Sprite, x, y, Width, Height)                                   
Return     

;----------------------------------------
PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

@MrVain:
But i wanted a sprite bigger than the screen.

cya,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Andre.
But i wanted a sprite bigger than the screen.
Maybe drawing on an image (after CreateImage()) and then grabbing as sprites would help.... ?


Regards
André

*** German PureBasic Support ***
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

@Andre:
Can you please tell me how to convert the image to sprite ??
I dont have an idea atm, sorry...

My Screen is 800x600 and i want to create a sprite
that is 1600x600 and another one should be 850x650.
Only idea i got is to include 2 compressed empty
images (so compression is good) in the file and draw
on this 2 sprites.
Maybe you got another idea until Fred has added this ??

Thanks,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Andre.
Can you please tell me how to convert the image to sprite ??
Sorry Danilo, my mistake.

I thought, that GrabSprite is able to grab image data also from Images (with specified ID). My mistake...
Should read my own manual better...

But maybe some of you advanced coders are able to:
1. draw to an created image first
2. "grab" the sprite via CatchSprite() from the memory address of the previously created image ?




Regards
André

*** German PureBasic Support ***
Post Reply