00:00
00:00
Newgrounds Background Image Theme

Johndewey just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

library class question

368 Views | 1 Reply
New Topic Respond to this Topic

library class question 2010-12-20 12:20:07


I created a class called "bgitem" that extends the Sprite class and gives it a few extra variables. I've changed the base class of a handful of library items to Sprite and am trying to cast them as "bgitem"s.
Is there any way to convert them on the fly without creating an identical .as for every single library class?

public var building:bgitem = bgitem(new building1())

didn't work.

Response to library class question 2010-12-20 16:02:35


Instead of making the base class of building1 extend Sprite, make it extend bgitem. No need to cast. Give that a try.


BBS Signature