Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

transparency

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-15-2007, 09:29 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 366
Awards Showcase
Beta Tester 
Total Awards: 1
Default transparency

Writing some code now, 1st game where man has to jump onto a swinging rope.
Rope code is something like
For angle= -2 to 2 step .1
Line (120,120, 100*(1+sin(angle)),100*(1+cos(angle)),cBlack)
Next
..etc...

Obviously the rope leaves a trail of where it was before. Rather than drawing over the previous line in the background colour I wanted to try the
SetTransparencyColor function and then draw it to the foreground (I saw it was done like this in the clock program.)
What do I have to do to make this happen?

I tried SetTransparencyColor=CBlack, and put a ,f) at the end of the line command but it didnt make any difference. Do I specifically have to clear the foreground somehow before I redraw my rope.

I hope my question makes sense? Grateful for any help
Reply With Quote
  #2 (permalink)  
Old 11-16-2007, 07:37 AM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 366
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I see actually that the clock prog does clear a circle every tick, so what my question is ....
1) How does transparency funtion work & What happens when you settransparencycolor

2) Also I know how to do a line [form1.line(....] but cant work out how to do a point [tried form1.plot and form1.point] can someone tell me the keyword please?
Reply With Quote
  #3 (permalink)  
Old 11-16-2007, 08:07 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
can someone tell me the keyword please?
There isn't one.

Use "Form1.Line(x, y, x+1, y+1, color)" to set a single pixel.

Last edited by agraham : 11-16-2007 at 08:14 AM.
Reply With Quote
  #4 (permalink)  
Old 11-16-2007, 08:22 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,728
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

SetTransparentColor determines which color will be used as the transparent color (forelayer only).
You could use Form.FErase or draw on the forelayer with the transparent color to part of it.
Note that ImageLib gives more options for transparent drawings.
Reply With Quote
  #5 (permalink)  
Old 11-16-2007, 08:39 AM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 366
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Thanks - this Basic4PPC really is good - except Ive found one prob I will have to work round ...
....I had my program DrawRope which twirled a rope round BUT I didnt see it till it had got to the end of the Sub. That is to say that the screen didnt refresh all the time the rope was moving - so I only saw the rope in the end position!!

Is that ususal for PocketPCs to only update the screen at the end of a proceedure or is this an issue with Basic4PPC ???

OK I could get round this by having the rope move each step by a TimerClick but is there anyway to force a screen refresh in the middle of a drawing loop?
Reply With Quote
  #6 (permalink)  
Old 11-16-2007, 08:43 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,728
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

If you are using a tight loop for the drawings then you can add DoEvents statement to cause the screen to redraw itself.
I recommend you to use Timer_Tick events instead.
Reply With Quote
  #7 (permalink)  
Old 11-16-2007, 09:00 AM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 366
Awards Showcase
Beta Tester 
Total Awards: 1
Default

great thanks - last question.

Im using a HTC VGA Universal, but it plots to the screen as if its only 320x240.
I tried going into the form and changing the property dimensions but I couldnt edit those boxes.

1) How do I make a program findout if the screen is VGA?
2) How do I then do line(0,0,640,0, ..) etc
Reply With Quote
  #8 (permalink)  
Old 11-16-2007, 10:03 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,728
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

See this link: http://www.basic4ppc.com/forum/code-samples-tips/786-true-vga-possible-basic4ppc.html
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Sprites and Transparency Drewpeu Questions (Windows Mobile) 1 09-24-2008 06:29 PM


All times are GMT. The time now is 05:53 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0