Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Basic4ppc Wishlist
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Basic4ppc Wishlist Missing any feature?

Sprite attributes (properties)

Reply
 
LinkBack Thread Tools Display Modes
  #91 (permalink)  
Old 01-12-2010, 05:59 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by merli View Post
Except I did not know that I will need to put them invisible then tick and visible and tick
I didn't say that you would need to do this, only that you might need to as I haven't tried using Sprites that way. Try it without first as that would be more efficient
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #92 (permalink)  
Old 01-21-2010, 07:26 AM
Junior Member
 
Join Date: Sep 2009
Posts: 18
Default

Thanks for help. It is working OK without invisible/visible trick, but there is one problem. If I delete sprite with sprite.MarkForDelete and gw.DeleteMarkedSprites and then I add same sprite again through gw.AddSprite or gw.ReplaceSprite then I have to set this sprite.IsActive=True to be seen on screen. Is it feature (planned to work this way) or bug?

I wonder how fast it will be when I will need to reorder (delete insert) this way 20 or more sprites each tick. We'll see
Reply With Quote
  #93 (permalink)  
Old 01-21-2010, 09:15 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by merli View Post
Is it feature (planned to work this way) or bug?
It's a feature that occurs because you are using the sprites in a way that they were not really designed for.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #94 (permalink)  
Old 01-21-2010, 11:40 AM
Junior Member
 
Join Date: Sep 2009
Posts: 18
Default

I am sorry, but that is the only way I found how to make redrawing objects fast.
now
1) I draw 3d objects using drawer to create sprite graphics.
2) then I sort objects by visibility
3) I put objects in right order into GW.

When I tried to do it directly into form I ended with slideshow presentation.
Now it works.

Is there any way how to cast shadows? I mean one sprite is casting shadow 10 pixels to the right and bellow objects are visible through that shadow. I mean some kind of transparency. What I am try to do is something like this:
Fenstalker Studios It is in flash, but I really don't understand how that guy is making shadow.
Reply With Quote
  #95 (permalink)  
Old 01-21-2010, 12:27 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

I don't understand why you are using the Sprite library for this. You have to draw your objects to bitmaps anyway so why aren't you drawing directly to a Bitmap using Drawer.DrawImage? It should be faster than messing around with Sprites.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #96 (permalink)  
Old 01-21-2010, 02:40 PM
Junior Member
 
Join Date: Sep 2009
Posts: 18
Default

I am using now Sprite library because I need to move objects on form (it should be a kind of game) and there are problems with moving objects on form. For moving object I need
1) delete object
2) restore somehow all what was covered by deleted object (it could be background or another objects or just their parts)
3) move object in selected direction
4) recount visibility - order of ojects can change
5) draw object moved

When I wrote som kind of algorithm for above it had bugs and was slow like hell and I had big problems with point 2) that is exactly what sprite library is doing for me ... Libray remembers what is covered by Sprite when moving. Just order of sprites has to be OK. If I swith collison off (because i need to calculate collision by myself in 3D) and most objects won't move maybe I will manage to be fast.
Reply With Quote
  #97 (permalink)  
Old 01-21-2010, 02:58 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

You don't need to do 1) and 2). Keep a copy of the background in one bitmap and every frame use DrawImage to draw it onto another bitmap and draw the objects on the second bitmap in the order that you want then when you have finished use DrawImage again to copy that bitmap to the one being displayed in an Image Control.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #98 (permalink)  
Old 01-21-2010, 11:13 PM
Junior Member
 
Join Date: Sep 2009
Posts: 18
Default

You are right, but in this case I have to draw all objects each game tick, which I wanted to avoid and redraw just what is needed :-). But anyway I know that now using sprites I do the same thing. When sprites won't work for me I will change drawing routines again
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Properties module - useful module for working with properties / ini files Erel Code Samples & Tips 2 10-13-2011 10:02 PM
Assembly properties Pachuquin Questions (Windows Mobile) 1 05-05-2009 06:42 PM
Compiled Properties Zenerdiode Basic4ppc Wishlist 2 03-06-2009 08:08 PM
Evaluate properties Offbeatmammal Basic4ppc Wishlist 0 06-02-2008 07:23 AM
More properties for panels RandomCoder Basic4ppc Wishlist 0 07-12-2007 09:48 PM


All times are GMT. The time now is 03:57 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0