Go Back   Zune Boards > Zune Discussions > Zune Games > Development Discussions > Development Help

Development Help For help from coding to error finding to that one thing you just can't get right

Reply
 
LinkBack Thread Tools
Old 11-07-2009, 05:41 PM   #1 (permalink)
Experienced Member
 
Join Date: May 2008
Posts: 860
Berty is on a distinguished road
Default Sprite Issues!!! Helpa Me Please

ok, well, what is going on here is im porting my zGuitarTuner to zhd. My Problem is, that the sprite is not drawing properly.

In my original version (for zsd that work fine) i have one long sprite of many chord charts, that i scroll through by adding to the x value of the new vector

in my zhd version i have the exact same setup (scrolling method a lil different cause it is easier to code) but my sprite seems to just smear off into the distance?

This video pretty much sums it up!

__________________
--new--zGuitarTuner2.1--new--
Now Works With All Zune Models!
Quote:
We talked about this. Bypass the word filter again and you'll be infracted.
-Seb






Berty is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old 11-08-2009, 09:13 AM   #2 (permalink)
Experienced Member
 
Tiptup300's Avatar
 
Join Date: Apr 2008
Posts: 805
Tiptup300 has disabled reputation
Default

Would you mind posting the drawing code?



Tiptup300 is offline   Reply With Quote
Old 11-08-2009, 09:27 AM   #3 (permalink)
lost in paradise with rae
Support Team
Moderator
Expert Zuner
 
Red Sky's Avatar
 
Join Date: Nov 2007
Location: Pennsylvania
Posts: 2,660
Red Sky is just really niceRed Sky is just really niceRed Sky is just really nice
Send a message via MSN to Red Sky
Default

have you done a GraphicsDevice.Clear(Color.Black) before drawing your sprite?





Red Sky is offline   Reply With Quote
Old 11-09-2009, 12:33 PM   #4 (permalink)
Experienced Member
 
Join Date: May 2008
Posts: 860
Berty is on a distinguished road
Default

@ Red Sky, yes, yes i have

um its a long Draw so... ill post what is needed

Quote:

protectedoverridevoid Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.Black);

spriteBatch.Begin(SpriteBlendMode.AlphaBlend);

if (screen == 20)
{
if (turndevice == true)
{
spriteBatch.Draw(turndevicescreen, viewportRect, Color.White);
}
if (turndevice == false)
{
spriteBatch.Draw(A1, newVector2(100, 60 + noteposition), Color.White);

spriteBatch.DrawString(font, "A", newVector2(200, 63),Color.White,
(float)Math.PI / 2, newVector2(0, 0), 1.0f, SpriteEffects.None, 0.0f);

spriteBatch.Draw(leftarrow, leftarrowRect, Color.White);

spriteBatch.Draw(rightarrow, rightarrowRect, Color.White);

}
}
spriteBatch.End();
base.Draw(gameTime);
}
__________________
--new--zGuitarTuner2.1--new--
Now Works With All Zune Models!
Quote:
We talked about this. Bypass the word filter again and you'll be infracted.
-Seb






Berty is offline   Reply With Quote
Old 11-09-2009, 12:39 PM   #5 (permalink)
lost in paradise with rae
Support Team
Moderator
Expert Zuner
 
Red Sky's Avatar
 
Join Date: Nov 2007
Location: Pennsylvania
Posts: 2,660
Red Sky is just really niceRed Sky is just really niceRed Sky is just really nice
Send a message via MSN to Red Sky
Default

how do you update note position after the end of the list has been reached? You might simply be drawing the same note over and over again, but the position changes slightly so it looks like it 'blurs' when it's really just a ton of the same image drawn again.

Edit:

upon watching the video a second time, this doesn't appear to be what happens.





Red Sky is offline   Reply With Quote
Old 11-09-2009, 01:33 PM   #6 (permalink)
Experienced Member
 
Join Date: May 2008
Posts: 860
Berty is on a distinguished road
Default

um, well its just the same, it just keeps moving the sprite to the left or right even outside of the viewportrect
__________________
--new--zGuitarTuner2.1--new--
Now Works With All Zune Models!
Quote:
We talked about this. Bypass the word filter again and you'll be infracted.
-Seb






Berty is offline   Reply With Quote
Old 11-09-2009, 08:27 PM   #7 (permalink)
Experienced Member
 
Tiptup300's Avatar
 
Join Date: Apr 2008
Posts: 805
Tiptup300 has disabled reputation
Default

viewportRect's width must be bigger then the textures.... I guess the HD handles that differently.



Tiptup300 is offline   Reply With Quote
Old 11-10-2009, 03:26 AM   #8 (permalink)
Experienced Member
 
Join Date: May 2008
Posts: 860
Berty is on a distinguished road
Default

I don't think so, cause I can still scroll through most of the sprite that is outside of the viewportrect!
__________________
--new--zGuitarTuner2.1--new--
Now Works With All Zune Models!
Quote:
We talked about this. Bypass the word filter again and you'll be infracted.
-Seb






Berty is offline   Reply With Quote
Old 11-10-2009, 02:37 PM   #9 (permalink)
Zewbie
 
Join Date: Nov 2009
Location: Beverly, MA
Posts: 7
dnchattan is on a distinguished road
Default

Is it possible that the sprite went over the texture size limit for the ZuneHD? Try checking the width/height attributes of the actual texture in the debugger and see if they are correct.





dnchattan is offline   Reply With Quote
Old 11-10-2009, 06:47 PM   #10 (permalink)
Experienced Member
 
Join Date: May 2008
Posts: 860
Berty is on a distinguished road
Default

Yeah, that's what I was wondering, because I'm using the exact same size as the ones I used that worked in my last version ( on standered Zunes )
__________________
--new--zGuitarTuner2.1--new--
Now Works With All Zune Models!
Quote:
We talked about this. Bypass the word filter again and you'll be infracted.
-Seb






Berty is offline   Reply With Quote
Old 11-10-2009, 07:44 PM   #11 (permalink)
Experienced Member
 
Tiptup300's Avatar
 
Join Date: Apr 2008
Posts: 805
Tiptup300 has disabled reputation
Default

wait is the texture drawing part the

"spriteBatch.Draw(A1, newVector2(100, 60 + noteposition), Color.White);" bit?

Because that doesn't make sense... it wouldn't be moving at all.



Tiptup300 is offline   Reply With Quote
Old 11-10-2009, 07:49 PM   #12 (permalink)
Experienced Member
 
Join Date: May 2008
Posts: 860
Berty is on a distinguished road
Default

Yeah........ That's the bit!
__________________
--new--zGuitarTuner2.1--new--
Now Works With All Zune Models!
Quote:
We talked about this. Bypass the word filter again and you'll be infracted.
-Seb






Berty is offline   Reply With Quote
Old 11-11-2009, 07:45 PM   #13 (permalink)
Experienced Member
 
Tiptup300's Avatar
 
Join Date: Apr 2008
Posts: 805
Tiptup300 has disabled reputation
Default

Do you rotate the screen at all?



Tiptup300 is offline   Reply With Quote
Old 11-11-2009, 08:16 PM   #14 (permalink)
Experienced Member
 
Join Date: May 2008
Posts: 860
Berty is on a distinguished road
Default

um.... what? I do have the Zune tilted, but not the sprite
__________________
--new--zGuitarTuner2.1--new--
Now Works With All Zune Models!
Quote:
We talked about this. Bypass the word filter again and you'll be infracted.
-Seb






Berty is offline   Reply With Quote
Old 11-12-2009, 08:34 AM   #15 (permalink)
Experienced Member
 
Tiptup300's Avatar
 
Join Date: Apr 2008
Posts: 805
Tiptup300 has disabled reputation
Default

How does the sprite move, is that code the exact code you use or was it just like paraphrased? Because that code wouldn't work at all there.



Tiptup300 is offline   Reply With Quote
Old 11-12-2009, 03:34 PM   #16 (permalink)
Experienced Member
 
Join Date: May 2008
Posts: 860
Berty is on a distinguished road
Default

Uh.... thats the DRAW code........ the update Gametime code is simply if i press in those arrows, noteposition += 4; or noteposition -= 4;
__________________
--new--zGuitarTuner2.1--new--
Now Works With All Zune Models!
Quote:
We talked about this. Bypass the word filter again and you'll be infracted.
-Seb






Berty is offline   Reply With Quote
Old 11-12-2009, 11:40 PM   #17 (permalink)
Experienced Member
 
Tiptup300's Avatar
 
Join Date: Apr 2008
Posts: 805
Tiptup300 has disabled reputation
Default

I gather that, but

Code:
spriteBatch.Draw(A1, newVector2(100, 60 + noteposition), Color.White);
That wouldn't even compile first off (newVector2), and it would move it vertically not horizontally...



Tiptup300 is offline   Reply With Quote
Old 11-13-2009, 01:23 AM   #18 (permalink)
zB Programmer
Member
 
DiNoGames's Avatar
 
Join Date: May 2008
Location: Bremen, germany
Posts: 577
DiNoGames is a name known to allDiNoGames is a name known to allDiNoGames is a name known to allDiNoGames is a name known to all
Send a message via Skype™ to DiNoGames
Default

It actually moves vertically... he just turned the Zune Device so that it looks horizontally again...
__________________

Valgard's Fate Blog







DiNoGames is offline   Reply With Quote
Old 11-13-2009, 10:29 AM   #19 (permalink)
Experienced Member
 
Tiptup300's Avatar
 
Join Date: Apr 2008
Posts: 805
Tiptup300 has disabled reputation
Default

Quote:
Originally Posted by DiNoGames View Post
It actually moves vertically... he just turned the Zune Device so that it looks horizontally again...
I asked him if he rotated the screen....



Tiptup300 is offline   Reply With Quote
Old 11-16-2009, 12:47 AM   #20 (permalink)
zB Programmer
Member
 
DiNoGames's Avatar
 
Join Date: May 2008
Location: Bremen, germany
Posts: 577
DiNoGames is a name known to allDiNoGames is a name known to allDiNoGames is a name known to allDiNoGames is a name known to all
Send a message via Skype™ to DiNoGames
Default

You can see it in the video.
Maybe he thought you mean turning the screen by code using a rendertarget or something (landscape mode).
__________________

Valgard's Fate Blog







DiNoGames is offline   Reply With Quote
Reply

Bookmarks

Thread Tools