Development Help For help from coding to error finding to that one thing you just can't get right
11-07-2009, 05:41 PM
#1 (permalink )
Experienced Member
Join Date: May 2008
Posts: 860
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!
__________________
Now Works With All Zune Models!
Quote:
We talked about this. Bypass the word filter again and you'll be infracted.
-Seb
11-08-2009, 09:13 AM
#2 (permalink )
Experienced Member
Join Date: Apr 2008
Posts: 805
Would you mind posting the drawing code?
11-08-2009, 09:27 AM
#3 (permalink )
lost in paradise with rae
Support Team Moderator Expert Zuner
Join Date: Nov 2007
Location: Pennsylvania
Posts: 2,660
have you done a GraphicsDevice.Clear(Color.Black) before drawing your sprite?
11-09-2009, 12:33 PM
#4 (permalink )
Experienced Member
Join Date: May 2008
Posts: 860
@ Red Sky, yes, yes i have
um its a long Draw so... ill post what is needed
Quote:
protected override void 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, new Vector2 (100, 60 + noteposition), Color .White);
spriteBatch.DrawString(font, "A" , new Vector2 (200, 63), Color .White,
( float ) Math .PI / 2, new Vector2 (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);
}
__________________
Now Works With All Zune Models!
Quote:
We talked about this. Bypass the word filter again and you'll be infracted.
-Seb
11-09-2009, 12:39 PM
#5 (permalink )
lost in paradise with rae
Support Team Moderator Expert Zuner
Join Date: Nov 2007
Location: Pennsylvania
Posts: 2,660
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.
11-09-2009, 01:33 PM
#6 (permalink )
Experienced Member
Join Date: May 2008
Posts: 860
um, well its just the same, it just keeps moving the sprite to the left or right even outside of the viewportrect
__________________
Now Works With All Zune Models!
Quote:
We talked about this. Bypass the word filter again and you'll be infracted.
-Seb
11-09-2009, 08:27 PM
#7 (permalink )
Experienced Member
Join Date: Apr 2008
Posts: 805
viewportRect's width must be bigger then the textures.... I guess the HD handles that differently.
11-10-2009, 03:26 AM
#8 (permalink )
Experienced Member
Join Date: May 2008
Posts: 860
I don't think so, cause I can still scroll through most of the sprite that is outside of the viewportrect!
__________________
Now Works With All Zune Models!
Quote:
We talked about this. Bypass the word filter again and you'll be infracted.
-Seb
11-10-2009, 02:37 PM
#9 (permalink )
Zewbie
Join Date: Nov 2009
Location: Beverly, MA
Posts: 7
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.
11-10-2009, 06:47 PM
#10 (permalink )
Experienced Member
Join Date: May 2008
Posts: 860
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 )
__________________
Now Works With All Zune Models!
Quote:
We talked about this. Bypass the word filter again and you'll be infracted.
-Seb
11-10-2009, 07:44 PM
#11 (permalink )
Experienced Member
Join Date: Apr 2008
Posts: 805
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.
11-10-2009, 07:49 PM
#12 (permalink )
Experienced Member
Join Date: May 2008
Posts: 860
Yeah........ That's the bit!
__________________
Now Works With All Zune Models!
Quote:
We talked about this. Bypass the word filter again and you'll be infracted.
-Seb
11-11-2009, 07:45 PM
#13 (permalink )
Experienced Member
Join Date: Apr 2008
Posts: 805
Do you rotate the screen at all?
11-11-2009, 08:16 PM
#14 (permalink )
Experienced Member
Join Date: May 2008
Posts: 860
um.... what? I do have the Zune tilted, but not the sprite
__________________
Now Works With All Zune Models!
Quote:
We talked about this. Bypass the word filter again and you'll be infracted.
-Seb
11-12-2009, 08:34 AM
#15 (permalink )
Experienced Member
Join Date: Apr 2008
Posts: 805
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.
11-12-2009, 03:34 PM
#16 (permalink )
Experienced Member
Join Date: May 2008
Posts: 860
Uh.... thats the DRAW code........ the update Gametime code is simply if i press in those arrows, noteposition += 4; or noteposition -= 4;
__________________
Now Works With All Zune Models!
Quote:
We talked about this. Bypass the word filter again and you'll be infracted.
-Seb
11-12-2009, 11:40 PM
#17 (permalink )
Experienced Member
Join Date: Apr 2008
Posts: 805
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...
11-13-2009, 01:23 AM
#18 (permalink )
zB Programmer Member
Join Date: May 2008
Location: Bremen, germany
Posts: 577
It actually moves vertically... he just turned the Zune Device so that it looks horizontally again...
11-13-2009, 10:29 AM
#19 (permalink )
Experienced Member
Join Date: Apr 2008
Posts: 805
Quote:
Originally Posted by
DiNoGames
It actually moves vertically... he just turned the Zune Device so that it looks horizontally again...
I asked him if he rotated the screen....
11-16-2009, 12:47 AM
#20 (permalink )
zB Programmer Member
Join Date: May 2008
Location: Bremen, germany
Posts: 577
You can see it in the video.
Maybe he thought you mean turning the screen by code using a rendertarget or something (landscape mode).