[Superbackgammon-developer] İlgi: canvas vs. gamecanvas
Status: Planning
Brought to you by:
ugur_tutar
|
From: Ç. K. <cki...@gm...> - 2008-12-12 19:37:27
|
tamam emre ya, ben sadece "AND"lemeden tuş okumanın bi yolunu bulduğum için öyle bi kod gönderdim. sen öyle diyosan tabiki de senin dediğin olcak ;) bu arada pazar günü ben eskişehir'de olcam. pazar günü görüşelim mi? 2008/12/12, Abc Tuvyz <ora...@ya...>: > çalarcım ya gerçekten bu canvas olayı zurnanın son deliği > > 1 - en mantıklısı adamlar bunu özellikle oyun yapanlar için çıkarmış birsuru > ek özelliği var ve ilerde işimize yarayacağına inanıyorum millet canvastan > kurtulduğuna dua ederken biz niye eskiye dönup uğraşalım jdk 1.6 varken 1.4 > e göç etmek gibi bişi > > 2- canvasta yapamak gercekten stabil değil > > The GameCanvas class is a subclass of javax.microedition.lcdui.Canvas, but > differs in two ways: graphics buffering and the ability to query key states. > These features of the GameCanvas class offer you enhanced control to deal > with events like keystrokes and screen repainting. > > As I mentioned earlier, you'll get smoother animation if you create graphics > objects behind the scenes, in a buffer, then update and repaint the screen > simply by invoking paint(getGraphics()) and flushGraphics(). If your > graphics are simple, you may not notice much difference if you call > repaint() and serviceRepaints() instead, but in games with complex graphics, > using the GameCanvas methods will make an appreciable difference. > > The GameCanvas class makes game programming much easier. You can extend the > Canvas class directly to develop your game if you want, but if you do you'll > need to implement the Canvas.keyPressed() method, which is called whenever > the user presses a button. Errors can arise if the call occurs when multiple > threads are doing different things and the code is not properly > synchronized. By contrast, if you use GameCanvas you can get the keystroke > information whenever you want it, from the getKeyStates() method – and in a > more useful form: The keyCode passed to Canvas.keyPressed() gives you > information about only a single key, but GameCanvas.getKeyStates() tells you > when multiple keys are being pressed simultaneously. > > The GameCanvas class simplifies game programming in another way. Instead of > spreading the logic across multiple methods running on separate threads, as > Canvas does, GameCanvas lets you combine all the game functionality in a > single loop, under the control of a single thread. Code Sample 2 is a > rewrite of Code Sample 1 that uses GameCanvas, and encloses the game's logic > in a single loop: > > 3- bütün bunlar olmasa dahi okadar kod yazıldı ve hepsi sıfırdan yapmak > vakit kaybı. > > velhasılkelam bence gamecanvasa dokunmayalım yoksa ben uğraşmam grafikle fln > beni başka bi parçaya verin siz yeniden yazarsınız icab edeni benden > canvasla devam etmemi beklemeyin. > > herkese iyi bayramlar > > > > -- Caglar Kilimci Computer Engineering, 4th Class Yunusemre Cd. Tura Apt. 70/13 Eskishir/TURKEY Phone: +905054012959 |