Skip to main content

Microsoft Silverlight

Answered Question !viewportrect.contains errorRSS Feed

(0)

Spl33n Master
Spl33n M...

Member

Member

1 points

5 Posts

!viewportrect.contains error

I get 4 of these errors.

 Error 5 'SilverArcade.SilverSprite.Rectangle' does not contain a definition for 'Contains' and no extension method 'Contains' accepting a first argument of type 'SilverArcade.SilverSprite.Rectangle' could be found (are you missing a using directive or an assembly reference?)

if public void UpdateCannonBalls()

 {

foreach (GameObject ball in cannonballs)

 {

if (ball.alive)

{

ball.position += ball.velocity;

 if (!viewportRect.Contains(new Point

((int)ball.position.X, (int)ball.position.Y)))

{

 ball.alive = false; continue;

 }

What reference do i add?

What reference do I add? Theres also 2 errors for resetElapsedTime.

Same error as above only exception is it says SilverArcade.SilverSprite.Rectangle.

 

Thanks.

mchlsync
mchlsync

Star

Star

14606 points

2,730 Posts

Silverlight MVP
Answered Question

Re: !viewportrect.contains error

It would be great if you can provide more information. Everyone doesn't know what 'SilverArcade.SilverSprite.Rectangle'  is.

Based on your error, it seems like you are using Contains method that doesn't exist in 'SilverArcade.SilverSprite.Rectangle' . So, remove the code that use this Contain method or create an extension method for that.

(If this has answered your question, please click on "Mark as Answer" on this post. Thank you!)

Regards,
Michael Sync
Silverlight MVP

Blog : http://michaelsync.net


Bill Reiss
Bill Reiss

Contributor

Contributor

4840 points

919 Posts

Silverlight MVP
Answered Question

Re: !viewportrect.contains error

I have answered this on the SilverSprite discussion forum since it is a SilverSprite and not a Silverlight issue.


Bill Reiss, Coauthor of Hello! Silverlight 3
My blog (rss feed)
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities