backGroundPattern and Selective Transparency on Objects

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm

backGroundPattern and Selective Transparency on Objects

Post by deeverd » Mon Dec 17, 2007 5:16 pm

Hello Again,

I've spent many hours over the past weekend trying every possible way I could think of to change the blendLevel settings of a backGroundPattern without also affecting any of the objects on the card.

Is there a way to accomplish this task? I'd like to be able to fade out the backGroundPattern of the card so it doesn't overwhelm the visibility of the buttons and fields and other controls, but everything else fades out with the backGroundPattern.

The only working solution I could find was to set a field against the back of the card and then float the objects on top of it, but it would be nice to be able to just fade out the backGroundPattern of a card like I was trying.

As always, any hints along these lines would be greatly appreciated.
All the best, deeverd

Garrett
Posts: 386
Joined: Sat Apr 08, 2006 8:15 am
Contact:

Post by Garrett » Mon Dec 17, 2007 10:30 pm

Same here, all I came up with was a field element using the background pattern I wanted to use and setting the blendlevel of that field element.

deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm

Post by deeverd » Mon Dec 17, 2007 11:04 pm

If there isn't a way, what I might try doing in the future is to create a "blank" jpeg image that I can just paste as a background, then set the backgroundPattern to that, and finally set the blendLevel to that image. I might even create a bunch of them beforehand with blendLevels already preset, using the 34 major backgroundPatterns that come with Revolution, and that way I can just drop in any of those semi-transparent images as a background when I need them.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Tue Dec 18, 2007 1:46 pm

Deeverd,

You wrote:
change the blendLevel settings of a backGroundPattern without also affecting any of the objects on the card
Frankly, I don't have the faintest idea of what you'r trying to do. Are you setting the blendlevel of a background? Of a card? Of an image? A field? Something completely different?

All I do notice is that you are probably struggling with the ineritence of properties, although I am not sure. Also, I don't understand what you are trying to achieve, because the card itself won't become transparent this way. Why don't you simply make a new background picture that is not that dominant and import that into Rev to use it as a pattern?

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm

Post by deeverd » Tue Dec 18, 2007 4:20 pm

Hi Mark,

To answer your question, what I was trying to do, and it sounds like Garrett was also trying to do was to set a backGroundPattern to a card, and then use the blendLevel script to make that backGroundPattern more transparent without affecting all the buttons and fields that also become more transparent because of that setting. In other words, I wanted to blend the backGroundPattern into the background but keep the buttons and fields looking sharp.

I don't think it can be done in this manner, and I had come to a similar conclusion as yourself that it would probably be better to apply the backGroundPattern to an image which can be placed in the back, rather than setting a backGroundPattern to a whole card. However, it's always worth asking such Revolution experts as yourself whether there is a way or not. I'm always amazed what I discover and keep growing as an avid newbie programmer.

Cheers, deeverd

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Tue Dec 18, 2007 5:29 pm

Hi Deeverd,

Don't use images all over the place (if I understand you correctly, that's what you intend to do). Instead, create an empty group, set the rect of the group to the card rect and set its opaque and lockLoc to true. Set the backgroundPattern of the group to the id of your image and make sure that the layer of the group is always 1. Now you can set the blendlevel of the background without affecting other objects.

Now the question remains, why don't you simply alter your background picture in an image editor and import it into Revolution again?

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm

Post by deeverd » Tue Dec 18, 2007 5:43 pm

Hi Mark.

Thanks for the tip. I'll definitely try it. In answer to your question, in this case it's not so much that I have an image that I want to turn into a backgroundPattern. I happen to like some of the backgroundPatterns that are inherent in Revolution, and have been trying to find a way to tone done those patterns to use as backgrounds on cards while keeping all the controls in bright focus.

Actually, this question came about for me because I created a floating wallpaper palette and a slider that allows users to modify the backgroundPattern on some of my standalone programs, which is why I was wondering how to tone those backgroundPatterns down to make the cards easier to see.

All the best, deeverd

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Tue Dec 18, 2007 7:23 pm

Things are easiest to see when there is no background pattern at all, a fact even Steve Jobs seems to know since recently, after more then five years of pinstripes. ;-)
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Post Reply