You Are Here:

Community: Developer Discussion Boards

#1 Old display problem - 2009-07-02, 14:53

Join Date: Nov 2007
Posts: 34
bakidilek
Offline
Registered User
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 10:04.
Reply With Quote

#2 Old Re: masking problem - 2009-07-03, 14:17

Join Date: Nov 2007
Posts: 34
bakidilek
Offline
Registered User
is there anyone can HELP ME? PLEASE
Reply With Quote

#3 Old Re: masking problem - 2009-07-04, 14:12

Join Date: Apr 2009
Posts: 65
nirpsis
Offline
Regular Contributor
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/
Reply With Quote

#4 Old Re: masking problem - 2009-07-05, 00:01

Join Date: Nov 2007
Posts: 34
bakidilek
Offline
Registered User
THANKS for your reply and I know about masking.try the script

thanks
Reply With Quote

#5 Old Re: masking problem - 2009-07-05, 15:33

Join Date: Oct 2008
Posts: 11
Location: Turkey
Send a message via MSN to pys60tr
pys60tr
Offline
Registered User
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 With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia