Page 4 of 4

Re: Hexagons and stuff

Posted: Sat Aug 04, 2018 6:11 pm
by bwmilby
It worked for me.

Re: Hexagons and stuff

Posted: Sat Aug 04, 2018 6:21 pm
by richmond62
I faked all my *******.

Depends on which picture you import.

Re: Hexagons and stuff

Posted: Sun Aug 05, 2018 7:54 pm
by richmond62
What is wrong with this line?

Code: Select all

if (rect pLeft,pTop,pLeft+pWidth,pTop+pWidth of this card) is empty then

Re: Hexagons and stuff

Posted: Sun Aug 05, 2018 8:46 pm
by richmond62
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:

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

Re: Hexagons and stuff

Posted: Mon Aug 06, 2018 8:39 am
by richmond62
H5.png
-
Getting "somewhere", although the thing is still exporting hexagons without transparent borders:
-
r1c1.png
r1c1.png (10.59 KiB) Viewed 8219 times
-
HexSplit5.livecode.zip
Here's the stack.
(70.36 KiB) Downloaded 333 times

Re: Hexagons and stuff

Posted: Mon Aug 06, 2018 5:29 pm
by jacque
richmond62 wrote:
Sun Aug 05, 2018 7:54 pm
What is wrong with this line?

Code: Select all

if (rect pLeft,pTop,pLeft+pWidth,pTop+pWidth of this card) is empty then
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?
If the imported image is bigger than the stack everything screws up.
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.

Re: Hexagons and stuff

Posted: Mon Aug 06, 2018 5:54 pm
by richmond62
That's usually less intrusive than changing the window size, depending on the usage.
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.

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.
-
carc.jpg
-
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
-
Arras Map v2.jpg