Vector graphics

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

Post Reply
noloop
Posts: 13
Joined: Thu Oct 07, 2010 2:26 am

Vector graphics

Post by noloop » Sat Oct 09, 2010 2:39 am

I want to make a set of playing cards. So, I figured I'd make an image area the size of the card, and fill it with card images. Namely, suit and rank. I can't see a paint tool that allows me to type text as paint, as in the number "2".

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

Re: Vector graphics

Post by Mark » Sat Oct 09, 2010 2:54 am

noloop,

Use fields.

Kind regards,

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

noloop
Posts: 13
Joined: Thu Oct 07, 2010 2:26 am

Re: Vector graphics

Post by noloop » Sat Oct 09, 2010 5:01 am

You mean put the field inside the image area? Would I then group the two objects?

Part of the reason for using vector graphics is to have the playing change size if the window is resized. Scale to fit. Is that possible if the part os the card are displayed with a font and set size?

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Re: Vector graphics

Post by WaltBrown » Sat Oct 09, 2010 11:46 am

I think there's a bug in there somewhere. I tried making a playing card out of an image and a field in the corner. I would get the two perfectly scaled and sized, then the instant I grouped the two, the image would revert to it's original scale. Oh, never mind, pilot error, I needed to "Lock size and position" in it's properties first.

I took a snapshot using "import snapshot from grp". I can only resize it if it's angle is 0 degrees, resizing does not work at other angles. Also, if the angle is not 0, resizing causes it to revert to it's original size.

See attached stack for example. By the way, rename it to .rev or .livecode, I had to name it .zip to get past the bulletin board police, it's not realy a zip file. For some reason it refused entry to a .rev or .livecode file.

Walt
Attachments
ResizeRotateTest.zip
(127.09 KiB) Downloaded 315 times
Walt Brown
Omnis traductor traditor

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Re: Vector graphics

Post by WaltBrown » Sat Oct 09, 2010 11:55 am

Note that I fixed the jumping back to normal size by locking the size again of the image. This leads to a caveat - only lock the image while it is at an angle of 0 degrees. When an image is rotated, LC actually maps it to another 0 degrees rectangle, and it is that rectangle that gets resized. When I locked it at some other angle, the following rotate commands skewed the original image shape.

Walt
Walt Brown
Omnis traductor traditor

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Re: Vector graphics

Post by WaltBrown » Sat Oct 09, 2010 12:03 pm

No, it skews the image regardless. Apparently it's a bug, rotation of images appears to retain the image within it's original rectangle, so as it rotates it also scales. It needs a setting to retain it's original dimensions when rotated.
Walt
Walt Brown
Omnis traductor traditor

noloop
Posts: 13
Joined: Thu Oct 07, 2010 2:26 am

Re: Vector graphics

Post by noloop » Sun Oct 10, 2010 2:42 am

Hm. The various guides say image objects are bitmapped. I'm confused.

Bantymom
Posts: 73
Joined: Fri Aug 27, 2010 4:32 am

Re: Vector graphics

Post by Bantymom » Sun Oct 10, 2010 3:52 am

It is possible that I have no business replying here because I am very new to this, and it is possible that I don't understand what it is you are trying to do, but I'll give it a go, and if this isn't useful, I apologize.

I've been working with imported images (I'm no good at drawing things so I've not worked with the built-in graphics very much) in my project and have discovered that if I import an image the size I want it to be, I can make it smaller to be able to save several on the same card, later resetting them to the size I want when I copy them onto the card where they are needed.

I did find a few places online that offer free Vector images of playing cards that you could begin with for the images, but I wasn't very impressed with them, and I don't know how image-heavy you want to make your stack. I didn't reply when this first came up because it sounded as though you wanted to make the cards simple and with the graphics available in Revolution. However, since the discussion has turned to images, perhaps you are to the point where you are considering importing them.

If you decide to go that route, and if you have Photoshop (I have a very old version Photoshop Elements that barely runs on this OS, but it does the trick), you can use the "Save For Web" feature, set to a 2-color gif for most of the cards, to make the images very clean and with very small file sizes once you get them the way you want them.

I have also included a stack of playing cards that I think I found either on a page of tutorials or at RevOnline that might be helpful to you. (I found it when I was looking for a stack that I had seen that flipped playing card over, but I can't find it again and would really like to, if anyone reading this knows where to find that one)

Cheers,
Bantymom
Attachments
Playing Cards library.zip
(36.27 KiB) Downloaded 321 times
2nd-grade Teacher, Poultry Fancier, Scottish Country Dancer
and Perpetual Beginner

noloop
Posts: 13
Joined: Thu Oct 07, 2010 2:26 am

Re: Vector graphics

Post by noloop » Sun Oct 10, 2010 4:50 am

Hi. I appreciate the stack, and comments. Thank you.

Post Reply