×

Discussion Board

Results 1 to 5 of 5

Thread: masking problem

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    34

    display problem

    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)
    images here:

    http://bakidilek.googlepages.com/images.rar
    Last edited by bakidilek; 2009-07-04 at 09:04.

  2. #2
    Registered User
    Join Date
    Nov 2007
    Posts
    34

    Re: masking problem

    is there anyone can HELP ME? PLEASE

  3. #3
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    65

    Re: masking problem

    Quote Originally Posted by bakidilek View Post
    is there anyone can HELP ME? PLEASE
    Some tips here: http://wiki.forum.nokia.com/index.ph...vas_with_masks

    Hope it helps.
    --NirpSis

    http://sites.google.com/site/nirpsis/
    http://nirpsis.blogspot.com/

  4. #4
    Registered User
    Join Date
    Nov 2007
    Posts
    34

    Re: masking problem

    THANKS for your reply and I know about masking.try the script

    thanks

  5. #5
    Registered User
    Join Date
    Oct 2008
    Location
    Turkey
    Posts
    11

    Re: masking problem

    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

Similar Threads

  1. STLPort namespace issue
    By yickhong in forum Open C/C++
    Replies: 0
    Last Post: 2009-04-09, 08:54
  2. SyncML link problem
    By samuel_ in forum Symbian
    Replies: 4
    Last Post: 2009-03-27, 08:02
  3. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  4. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  5. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×