|
Post by syntaxerror on Apr 26, 2004 16:10:01 GMT
If you have any ideas/suggestions for either Image Packer, SpriteMasterPro, or ImageMaster please do so here. I'll endeavour to answer all of your posts. Thankyou.
|
|
|
Post by Slenkar on May 4, 2004 2:13:36 GMT
Hi I am using the "Loadsprite" command in BLitz3D to create a bullet that moves in a 3d world. This clashes with the loadsprite command in SmPro and creates an error.
Should I change the command in the smpro.bb file to loadspritem? or would that mess up something?
It turns out that there are more clashes with copysprite and other identically named commands and when I try to change the commands I get more errors from SmPro.bb because it uses the commands also,
Is it possible to use SmPro as a HUD for a 3D game?? It seems designed to be used for 2D games only.
|
|
|
Post by syntaxerror on May 5, 2004 16:48:25 GMT
Hi Slenkar, You'll have no problems renaming the LoadSprite() function. I figured programmers would not want to use normal sprites along with quad sprites. That's why I stole some of the Blitz commands.
Here is a list of commands overwritten:
* CreateSprite() LoadSprite() * RotateSprite * HandleSprite
* Renaming these commands/functions will break the code.
With regards to HUDS ... Yes. The SpriteGraphics command actually sets up a 3d display. The smPro sprites have an entity order of -100 be default so should appear in front of your objects.
It is best to keep all you HUD elements in on pack then extract/position them as required. That way you hud will only use ONE surface.
|
|
|
Post by Slenkar on May 5, 2004 18:40:12 GMT
hi, I am using 'rotatesprite' and 'copysprite' for my 3D particles is there a way to use your quads in 3D co-ords (as well as 2D co-ords) so I dont have to break the code and fix it?
thanks for your help
Am I supposed to use 'spritegraphics' instead of graphics3D?
I use several cameras in my game and they all need a seperate HUD according to which camera is selected, how do I make the sprites appear in front of different cameras?
I cant get text appear on the screen:
gfxwidth=800 gfxheight=600
Include "Smpro.bb"
SpriteGraphics gfxwidth,gfxheight
light=CreateLight() SeedRnd MilliSecs() HidePointer
AppTitle "Motherships"
Include "types-arrays.bb" Include "initialize-models.bb" Include "setup-ships.bb"
PositionEntity spritecamera,-100,20,0 TurnEntity spritecamera,0,-90,0
camera_internal=yes current_camera=spritecamera Global camera=spritecamera
Const desired_FPS=30 period=1000/desired_FPS
Global RW1curTime,RW1checkTime,RW1curFPS,RW1fpscounter Global UWcurTime,UWcheckTime,UWcurFPS, UWcounter UWcurFPS txt.smSprite=LoadFontSet("fontpack.png")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; While Not KeyDown(1) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Repeat elapsed=MilliSecs()-time Until elapsed ticks=elapsed/period ;how many 'frames' have elapsed tween#=Float(elapsed Mod period)/Float(period) ;fractional remainder For k=1 To ticks time=time+period ; If k=ticks Then CaptureWorld
;;;; Main start_logic_timer=MilliSecs()
If map_mode=no Controls()
If number_of_reds=0 For s.ship =Each ship If s\ship_type=bullet FreeEntity s\ship_handle FreeEntity s\pivot_handle Delete s EndIf Next Dock(blue,bluemom,bluemom_door,bluemom_door_pivot) EndIf
If number_of_blues=0 For s.ship =Each ship If s\ship_type=bullet FreeEntity s\ship_handle FreeEntity s\pivot_handle Delete s EndIf Next Dock(red,redmom,redmom_door,redmom_door_pivot) EndIf
If KeyHit(57) If paused=no paused=yes Else paused=no EndIf EndIf
If paused=no
If number_of_blues>0 If number_of_reds>0
Update_Ships()
Update_Missilers()
Update_Medium_Ships()
Update_Small_Ships()
Update_Pausers()
Update_Disruptors()
Update_Fighters()
Update_Projectiles()
Update_Turrets()
;blues>0 EndIf ;reds>0 EndIf ;paused=no EndIf ;map_mode=no EndIf
;;updates;;;;; RotateEntity temp_skybox,0,0,0,1 MoveMouse gwidth-14,gheight-15 time=MilliSecs() end_logic_timer=time logic_timer=end_logic_timer-start_logic_timer ;;;;;;;;;;;;;
SpriteText txt,"Hello World!",1 PositionSprite txt,50,50 CounterDisplay() UpdateWorld
UpdateWorldCounter()
Next If paused=no CSP_UpdateParticles() EndIf s_u_timer=MilliSecs() RenderWorld tween#
Flip
e_u_timer=MilliSecs() u_timer=e_u_timer-s_u_timer
RenderWorldCounter1()
Wend End
|
|
|
Post by Slenkar on May 6, 2004 3:13:46 GMT
function spritegraphics() spritecamera=CreateCamera() CameraClsMode spritecamera, False, False PositionEntity spritecamera, 0, -1000, 0 ; create a default sprite pivot spritepivot=CreateSpritePivot(spritecamera,pivotdist) ; mesh for rotating sprites rMesh=CreateMesh() : rMeshSurf=CreateSurface(rMesh) AddVertex rMeshSurf,0,0,0 : AddVertex rMeshSurf,0,0,0 AddVertex rMeshSurf,0,0,0 : AddVertex rMeshSurf,0,0,0 HideEntity rMesh : PositionEntity rMesh,-10000,-10000,0
Got it to work by making it act like, N_sprite by Gosse. The quads render to a seperate camera with its clsmode as false,false. The camera is positioned out of the game and can render its quads over any camera in the game. The sprite camera has to be created after the other cameras.
Is there a way to avoid loading the same textpack everytime I need to write a different message??
(Your text function is about 3million times faster than N_sprite)
|
|
|
Post by syntaxerror on May 6, 2004 20:34:59 GMT
You only have to load the text pack once. Then, just use SpriteText to change the text message.
Actually, all SpriteText does is set up some quads and pick the appropriate uv coords from the front pack texture.
Another tip. You don't have to call SpriteText every loop either. Only when you need to change the message. Same goes for displaying the sprites. Again, you only need to call say, PositionSprite to re-position a sprite etc...
Glad you found a way to do the separate camera stuff.
|
|
|
Post by Slenkar on May 7, 2004 16:32:45 GMT
thanks for the reply, The thing with my game is that I need a lot of information of the screen because its a realtime strategy game.
This means about 50 different strings to be displayed on screen at once and they have to be updated to show the relevant info.
There is no problem with the speed but in the program itself I have to put all these strings in one call to spritetext and therefore on one line of blitz code which gets a bit too much to put on one line.
Also I have no control over where they appear on screen except for being able to call a 'new line' (chr$(10)).
Each call to spritetext clears the screen so if I put these strings in seperate commands only the last one shows.
Is there a way around this?
|
|
|
Post by Slenkar on May 7, 2004 16:39:15 GMT
I came up with a solution, just split up the text into about 3 or 4 different calls to spritetext
|
|
|
Post by syntaxerror on May 7, 2004 17:45:58 GMT
I could do a AddSpriteText(sprite,text,x,y[,offset]) if that helps.
This would add text to the current sprite text without clearing the existing string.
Let me know what you think?
|
|
|
Post by Slenkar on May 7, 2004 18:55:23 GMT
Yeh that would be great, but if the sprite consists of some static stuff and a readout for the players score would it replace the old score or just get added to the sprite?
|
|
|
Post by syntaxerror on May 8, 2004 9:06:17 GMT
It's faster/easier to clear a text sprite then add the quads needed to make up the text message.
For scores which change all the time I suggest that you keep these as a unique text sprite.
Then, updating the static text and scores would go something like this:
; set up STATIC text txt.smSprite=LoadFontSet(...) PositionSprite scoretext,x,y SpriteText txt,"Player#1 Score:" AddSpriteText txt,"Player#2 Score:",x2,y2 AddSpriteText txt,"Player#3 Score:",x3,y3
; set up SCORE text scoretext.smSprite=LoadFontSet(...) PositionSprite scoretext,x,y
Repeat ; update scores SpriteText scoretext,player1\score AddSpriteText scoretext,player2\score,x2,y2 AddSpriteText scoretext,player3\score,x3,y3 Until ....
I'm thinking of updating the SpriteText to:
SpriteText mysprite,text$,x,y[,offset]
|
|
|
Post by Slenkar on May 8, 2004 15:48:08 GMT
Ah I get it, that would be great and very fast Thanks
|
|
|
Post by utimatehw on Feb 9, 2006 19:07:02 GMT
First of all, let me tell you that I'm trying to get ImagePacker to work for things not-involving Blitz. Secondly, here's my suggestions/comments: - *Not* re-sort images after removing one.
- Place images by dragging them using the mouse, with a snap-to-grid feature.
- Option to place images in row-column orientation (or column-row), instead of radiating them from the top-left corner.
- Resize tool-pane.
- Can't seem to get the program to output to 32-bit (including Alpha channel).
|
|