Hexagons and stuff
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Hexagons and stuff
It worked for me.
Brian Milby
Script Tracker https://github.com/bwmilby/scriptTracker
Script Tracker https://github.com/bwmilby/scriptTracker
-
- Livecode Opensource Backer
- Posts: 9443
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Hexagons and stuff
I faked all my *******.
Depends on which picture you import.
Depends on which picture you import.
-
- Livecode Opensource Backer
- Posts: 9443
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Hexagons and stuff
What is wrong with this line?
Code: Select all
if (rect pLeft,pTop,pLeft+pWidth,pTop+pWidth of this card) is empty then
-
- Livecode Opensource Backer
- Posts: 9443
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Hexagons and stuff
Aha . . .
If the imported image is bigger than the stack everything screws up.
So the stack has to be resized to take into account the size of the imported image:
If the imported image is bigger than the stack everything screws up.
So the stack has to be resized to take into account the size of the imported image:
Code: Select all
on mouseUp
set the vis of img "JOY" to false
if exists(img "map") then
delete img "map"
end if
answer file "Select a file" --with filter "Web Graphics,*.jpg;*.gif;*.png"
put it into theFilePath
if theFilePath = EMPTY then
exit mouseup
end if
import paint from file theFilePath
set the name of the last control to "map"
set the top of img "map" to 70
set the left of img "map" to 70
set the layer of img "map" to 1
set the top of img "IMP" to -100
put ((the height of img "map") + 140) into HITE
put ((the width of img "map") + 140) into WIDD
set the height of this stack to HITE
set the width of this stack to WIDD
set the top of this stack to 100
end mouseUp
-
- Livecode Opensource Backer
- Posts: 9443
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Hexagons and stuff
Getting "somewhere", although the thing is still exporting hexagons without transparent borders:
- -
-
- VIP Livecode Opensource Backer
- Posts: 7255
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Hexagons and stuff
It doesn't make any sense and won't parse. Only containers (usually variables) can be empty. This passes a reserved word and a series of unnecessary variables. What's the goal?richmond62 wrote: ↑Sun Aug 05, 2018 7:54 pmWhat is wrong with this line?
Code: Select all
if (rect pLeft,pTop,pLeft+pWidth,pTop+pWidth of this card) is empty then
That's a fairly common thing to do, though edges outside the card rect won't be visible. Is that what you mean? Another alternative is to resize the image to fit the card. That's usually less intrusive than changing the window size, depending on the usage.If the imported image is bigger than the stack everything screws up.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 9443
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Hexagons and stuff
If you play with my latest version (choosing a biggish image) you will see that the stack resizes to accommodate the image to be sliced.That's usually less intrusive than changing the window size, depending on the usage.
In the "gaming world", whether in terms of physical tiles on the table or the virtual equivalent, it is
fairly common to have vast maps made up of tiles.
- -
So one has to either put up with this or shift the image import and slicing off onto a substack and
hide it from the end-user's view.
http://flagsofvictory.blogspot.com/2014 ... n-out.html
-