[SOLVED] Creating a circular meter with code?


(azrafe7) #41

Yes, it’s your Draw call. Try changing to:

public function updateMeter():void
{
	trace(player.meter);
	bitmapData.fillRect(bitmapData.rect, 0); // clear bitmapData
	Draw.setTarget(bitmapData);
	// removed x, y from next call as they are relative to bitmapData and not to screen
	Draw.arcPlus(20, 20, 15, 60, player.meter * 18, player.inner.color, 1, true);
	Draw.resetTarget();
	img.updateBuffer();
}

Also, since I tested it, you’ll probably end up with the meter’s position being out of sync in respect to the player. If it does just update its pos in render(), or change it directly from player.update().


(TaylorAnderson) #42

Alright cool, it works now :stuck_out_tongue:

This has perhaps been the most I’ve learned in a single Flashpunk topic, so thanks guys!


(Zachary Lewis) #43

Even that topic where I posted half a season of Coin Duder? Or that topic where I added eleven more episodes of Coin Duder!? :cry:


(TaylorAnderson) #44

I never saw those :stuck_out_tongue: I’m not sure how much I’d learn from it now that I’ve been using FP for like, 2yrs


(Zachary Lewis) #45

You’d be surprised. You’ll learn over ten ways to fuck up what you’re trying to do!


Text effects found in A Thousand Years Of Dreams - there's support in Flash, but is it possible to mix .fla work and .as work in my flashpunk game?