| Reply | « Previous Thread | Next Thread » |
|
I'm trying to create a simple game but I'm having problem about masking.there are some black areas next to the object when I strat the script.I didn't use handle_redraw command in the script and dont want to use it because When I use the command the object is continuously shaking. I added the script and images that I used.please help me.
start the script then press 9 button on your phone to see the problem Code:
import appuifw, graphics, e32, sysinfo
from appuifw import *
from graphics import *
from key_codes import *
spx1=0
spy1=181
key=0
sp=1
appuifw.app.screen='full'
running=1
def quit():
global running
running=0
appuifw.app.exit_key_handler=quit
boardd={42:0,127:0,54:0,52:0,50:0,53:0,167:0,16:0,17:0,49:0,55:0,57:0}
def cbk(event):
global key
if event['type'] == appuifw.EEventKeyDown:
boardd[event['scancode']]=1
if event['type'] == appuifw.EEventKeyUp:
boardd[event['scancode']]=0
if event['type'] == appuifw.EEventKey:
key=event['keycode']
else: key=0
bg=Image.open(("E:\\Images\\Nazarlik\\resized1.png"))
ship1=Image.open("E:\\Images\\Fx\\gemit1.png")
shipm1=Image.new(size=(19,27),mode='1')
shipm1.load("E:\\Images\\Fx\\gemim1.png")
ship2=Image.open("E:\\Images\\Fx\\gemit2.png")
shipm2=Image.new(size=(19,27),mode='1')
shipm2.load("E:\\Images\\Fx\\gemim2.png")
ship3=Image.open("E:\\Images\\Fx\\gemit3.png")
shipm3=Image.new(size=(19,27),mode='1')
shipm3.load("E:\\Images\\Fx\\gemim3.png")
def ani(rect):
global key,spx1,spy1,sp
if boardd[57]==1 or (boardd[57]==1 and boardd[53]==1):
if spx1<157:
spx1 +=1
if sp==1:
c.blit(bg,target = (spx1-1,spy1),source = (spx1-1,spy1,spx1+1,spy1+27))
c.blit(ship1,target=(spx1,spy1),mask=shipm1)
sp+=1
if sp==2:
c.blit(bg,target = (spx1-1,spy1),source = (spx1-1,spy1,spx1+1,spy1+27))
c.blit(ship2,target=(spx1,spy1),mask=shipm2)
sp+=1
if sp==3:
c.blit(bg,target = (spx1-1,spy1),source = (spx1-1,spy1,spx1+1,spy1+27))
c.blit(ship3,target=(spx1,spy1),mask=shipm3)
if boardd[57] !=1 or (boardd[57]==0 and boardd[53]==1):
if sp==3:
c.blit(ship3,target=(spx1,spy1),mask=shipm3)
sp-=1
if sp==2:
c.blit(ship2,target=(spx1,spy1),mask=shipm2)
sp-=1
if sp==1:
c.blit(ship1,target=(spx1,spy1),mask=shipm1)
c = appuifw.Canvas(redraw_callback=None,event_callback = cbk)
appuifw.app.body = c
c.blit(bg)
while running:
ani(())
e32.ao_sleep(0.01)
http://bakidilek.googlepages.com/images.rar
Last edited by bakidilek : 2009-07-04 at 10:04.
|
|
is there anyone can HELP ME? PLEASE
|
|
--NirpSis http://sites.google.com/site/nirpsis/ http://nirpsis.blogspot.com/ |
|
THANKS for your reply and I know about masking.try the script
![]() thanks |
|
3rd phone no problem but the 2nd teleofon mask stays on track
this problem, please try to download pictures www.python-s60.com Turkish python |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| STLPort namespace issue | yickhong | Open C/C++ | 0 | 2009-04-09 09:54 |
| SyncML link problem | samuel_ | General Symbian C++ | 4 | 2009-03-27 09:02 |
| Problem with eglSwapBuffers and heap corruption | greatape | Symbian Media (Graphics & Sounds) | 2 | 2007-05-24 04:35 |
| netcards - Problem with opening adapter | kernj | Symbian Tools & SDKs | 5 | 2007-01-10 09:56 |
| Problem: S60 SDK for CW in PC with .NET | anttij | Carbide.c++ IDE and plug-ins | 1 | 2005-02-28 12:36 |