Page 1 of 2

Tiling a background image

Posted: Mon Oct 16, 2023 9:32 am
by richmond62
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 29766 times
-
Apart from messing around with an external image-processing program is there a way to do this directly inwith LiveCode?

Re: Tiling a background image

Posted: Mon Oct 16, 2023 9:36 am
by Klaus
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.

Re: Tiling a background image

Posted: Mon Oct 16, 2023 9:38 am
by Klaus
Read up -> backgroundpattern in the dictionary to see some caveats on Mac systems.

Re: Tiling a background image

Posted: Mon Oct 16, 2023 9:39 am
by richmond62
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'.

Re: Tiling a background image

Posted: Mon Oct 16, 2023 2:23 pm
by dunbarx
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

Re: Tiling a background image

Posted: Mon Oct 16, 2023 2:24 pm
by Klaus
Is this a trick question? :D

Re: Tiling a background image

Posted: Mon Oct 16, 2023 2:29 pm
by richmond62
I don't know as the grammar is so bad I cannot understand it properly.

Re: Tiling a background image

Posted: Mon Oct 16, 2023 2:32 pm
by richmond62
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

Re: Tiling a background image

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

Re: Tiling a background image

Posted: Mon Oct 16, 2023 3:14 pm
by richmond62
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

Re: Tiling a background image

Posted: Mon Oct 16, 2023 3:40 pm
by FourthWorld
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.

Re: Tiling a background image

Posted: Mon Oct 16, 2023 3:43 pm
by FourthWorld
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.

Re: Tiling a background image

Posted: Mon Oct 16, 2023 4:42 pm
by dunbarx
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

Re: Tiling a background image

Posted: Mon Oct 16, 2023 5:24 pm
by SparkOut
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

Re: Tiling a background image

Posted: Mon Oct 16, 2023 5:29 pm
by stam
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...)