Tiling a background image

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Tiling a background image

Post by richmond62 » Mon Oct 16, 2023 9:32 am

Let us just suppose I have a small image of, say 68 x 68 pixels which I should like to tile across the background of a card or a stack:
-
Jeans.jpg
Jeans.jpg (8.54 KiB) Viewed 24623 times
-
Apart from messing around with an external image-processing program is there a way to do this directly inwith LiveCode?

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Tiling a background image

Post by Klaus » Mon Oct 16, 2023 9:36 am

Does ->

Code: Select all

set the backgroundpattern of whatever to 1005
## last param is the image ID
not work for you?

However since this will be inherited, it may be a good idea to only set the bg pattern
of a graphic to your image, group the graphic and place the group on all cards you need to.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Tiling a background image

Post by Klaus » Mon Oct 16, 2023 9:38 am

Read up -> backgroundpattern in the dictionary to see some caveats on Mac systems.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Tiling a background image

Post by richmond62 » Mon Oct 16, 2023 9:39 am

I was wondering about setting the backGroundPattern of a card or even a stack.

And I really should have had that second cup of coffee. 8)
-
Screen Shot 2023-10-16 at 11.41.40 am.jpg
-
Well, caveats or not: works with LC 8.1.10 on MacOS 107 'Tired Lion'.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Tiling a background image

Post by dunbarx » Mon Oct 16, 2023 2:23 pm

For those with experience with other worlds, how often does it happen that a query from someone has the solution already built-in and ready-to go in the language?

Craig
Last edited by dunbarx on Mon Oct 16, 2023 4:36 pm, edited 1 time in total.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Tiling a background image

Post by Klaus » Mon Oct 16, 2023 2:24 pm

Is this a trick question? :D

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Tiling a background image

Post by richmond62 » Mon Oct 16, 2023 2:29 pm

I don't know as the grammar is so bad I cannot understand it properly.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Tiling a background image

Post by richmond62 » Mon Oct 16, 2023 2:32 pm

That field did NOT inherit anything.
-
Screen Shot 2023-10-16 at 4.31.56 pm.png
-
In some ways that might be rather nice:
-
Screen Shot 2023-10-16 at 4.39.10 pm.png

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Tiling a background image

Post by Klaus » Mon Oct 16, 2023 2:49 pm

richmond62 wrote:
Mon Oct 16, 2023 2:32 pm
That field did NOT inherit anything...
Ah, thanks, I was not sure.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Tiling a background image

Post by richmond62 » Mon Oct 16, 2023 3:14 pm

So, what inherits what from what?

This is far from clear, and does not seem to be properly documented.

For instance, a field does not inherit backGroundPattern or backGroundColor from a stack, but is does inherit its font setting:
-
Screen Shot 2023-10-16 at 5.12.20 pm.png

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Tiling a background image

Post by FourthWorld » Mon Oct 16, 2023 3:40 pm

dunbarx wrote:
Mon Oct 16, 2023 2:23 pm
For those with experience with other worlds, how often does it happen that a query from someone have the solution already built-in and ready-to go in the language?
As often as the question is for a basic essential.

For example, web pages had tiled backgrounds since almost the very beginning, and IIRC div elements (the basic building blocks of web UI objects) got them in the mid to late 90s. After the turn off the century we started to see attributes for those I'd still love to see in LC, like being able to control the origin point for the tiling.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Tiling a background image

Post by FourthWorld » Mon Oct 16, 2023 3:43 pm

richmond62 wrote:
Mon Oct 16, 2023 3:14 pm
So, what inherits what from what?

This is far from clear, and does not seem to be properly documented.

For instance, a field does not inherit backGroundPattern or backGroundColor from a stack, but is does inherit its font setting:
-
Screen Shot 2023-10-16 at 5.12.20 pm.png
That field appears to be overriding the inheritance, no? Try clearing its backgroundColor property and see if that allows the inheritance.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Tiling a background image

Post by dunbarx » Mon Oct 16, 2023 4:42 pm

Bad grammar? Where?

"Have", ah, autocorrect at work again. Fixed.

Perhaps did not understand the question; that is different.

I was making a point, as fan boys do now and then, that LC has within it most of the tools anyone could ever likely need, including odd use-case ones. In other words, someone simply refers one to an entry in the dictionary where the perfect solution sits ready and waiting. This happens often, and I was wondering if any other programming environment is as forthcoming.

Craig

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: Tiling a background image

Post by SparkOut » Mon Oct 16, 2023 5:24 pm

FourthWorld wrote:
Mon Oct 16, 2023 3:43 pm
That field appears to be overriding the inheritance, no? Try clearing its backgroundColor property and see if that allows the inheritance.
Or make it transparent

stam
Posts: 2686
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Tiling a background image

Post by stam » Mon Oct 16, 2023 5:29 pm

dunbarx wrote:
Mon Oct 16, 2023 4:42 pm
I was making a point, as fan boys do now and then, that LC has within it most of the tools anyone could ever likely need, including odd use-case ones. In other words, someone simply refers one to an entry in the dictionary where the perfect solution sits ready and waiting. This happens often, and I was wondering if any other programming environment is as forthcoming.

Craig
Your point it taken and I think is valid - LC does provide a lot of conveniences for the developer, which is why we all love it really.
Only sad to say newer developments and externals, not so much.

There was a recent discussion about how to sort the polyGrid. Yes it's simple.
But in the older days of the datagrid, they went the extra mile and gave you a build in handler to to this - and as a single object goes, the old datagrid has an absolutely phenomenal API which no modern external even comes close to - these are handlers that simplify life but in the newer PG/PL are absent and it's up to you to program these (much like any other IDE really, but I think that loses something...)

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”