Skinning Minimal Comps

1 comment

A lot of people have asked, and continue to ask how to skin minimal comps.

Short story, long story, what you can do.

Short story: you can't.

Long story: Minimal Comps were designed to be minimal. Mostly for use in prototypes and experiments. Their visual UI is hard coded and skinning was never, ever part of the design consideration. In fact, the opposite: skinning was specifically and with malice aforethought left out. There are a few reasons why this is the case.

First, the technical reasons. At risk of repeating myself, they are minimal. This means they are small and light weight and (hopefully) exceedingly simple to use. Allowing for skinning adds a surprising amount of complexity. Every component and every sub-part of every component needs to have a replaceable way of drawing itself. It winds up as a whole architecture in itself. All this adds file size, complexity, potential bugs, and learning curve.

Also, if I added some kind of minimal skinning capabilities, it would not be enough for many users. They would complain that it does not work the way it should, it is not flexible enough, it doesn't do X, Y, or Z, etc. It would wind up consuming more time and energy than I want to spend on it. Additionally, skinning would add a whole other API to the components beyond their functionality. This adds to the learning curve.

Finally, if you look at the architecture of the components, it is exceedingly flat. It is distinctly under-architected. If you examine all the classes that make up the components, there are very, very few that are not actual component classes in themselves. There is the Component class, which is the underlying base class for all components, Style, which contains some static color values, and Slider and UISlider, which are base classes for their vertical and horizontal subclasses. Other than that, each and every class in the package corresponds to exactly one component. There is some degree of inheritance and composition going on with the components themselves, but overall, there are no extraneous classes. I conceive that enabling skinning in any kind of useful, flexible way could add a significant amount of additional classes that would have to be compiled into every single class just to enable skinning, whether it was used or not.

Then there are the more... I don't know... not technical but... theoretical(?) reasons. Personally, I just feel that if you get to the point in a project where you need to skin these things, that should be a signal to you that the project has crossed that line between an experimental/prototype/minimalcomp-type project, and a real project that needs real, non-minimal, UI components. I'm honored that so many people like the components enough that they want to use them in larger projects where they would need to be skinned. But I honestly feel that you would be better off at a certain point looking at other, more skinnable components. There's Flex, which brings lots to the table and tons of customizability, and the CS4 components, which are easy to skin and style. Then there are plenty of 3rd party components sets. One to check out is my former coworker Ash's Razor Component Framework.

The long and the short of it is that I have no intention of adding skinning capabilities to the components at a core level. It has not been and is not any kind of priority and I don't foresee it becoming one.

What you can do: OK, take a look at the source. Each component has a draw method. Theoretically, this is where most of the visual UI of each component is created and updated. Draw is called whenever the component is resized or has anything done to it that would change its layout or appearance. If you want to skin a component, this is the stuff you need to change. You can extend the component class of your choice and override its draw method to do whatever you want:

Actionscript:
  1. public class SkinnedVSlider extends VSlider
  2. {
  3.     public override function draw():void
  4.     {
  5.         // do your own drawing here.
  6.     }
  7. }

I'm not saying this is necessarily going to be smooth and easy. Actually, if you look at Slider.draw, you'll see it calls drawBack and then drawHandle. So, you could either override both of those instead of draw, or just put all your skinning code in draw and ignore the other two. Again, since it wasn't designed with the idea of making this kind of thing easy in mind, you may run into various snags and problems. If there are some minor changes I can make to a component to make this kind of thing more easy, I'm willing to take a look at it.

Minimal Accordion and lots of fixes

no comments

I just added a new MInimal Component: an Accordion. It's pretty similar to what you see here: http://www.bit-101.com/blog/?p=2313, i.e. a VBox with Windows, but I made into it's own class with a few nice touches.

A new Accordion starts with two sections. You can add more with accordion.addWindow("New Window Title");. You can access any window with accordion.getWindowAt(index);. See it in action at http://www.minimalcomps.com.

It's in the new 0.99 SWC/Source that is now on Google Code, along with a bunch of bug fixes and updates to the existing code. The next main thing I want to focus on is a scroll bar, which will make a few other, much needed components possible, but this one was really easy to bang out.

Announcing www.minimalcomps.com

7 comments

This is long overdue. Minimal Comps have been a sort of side project of mine, and have various posts here related to them, but enough people are using them and apparently liking them, that it seemed they deserved a home of their own.

http://www.minimalcomps.com

The site is nothing fancy (minimal?), and it seemed fitting to use the components to make the site, but at least it serves as a single point where people can go to find out what they are, where to get them, see demos and examples, get documentation, find out where to report bugs, etc.

Also, note that I had been pretty remiss about addressing bugs and issues in the past. I didn't have the issue tracker set up to notify me about new issues, so had no idea there were so many in there. I think I handled almost all of the ones that were in there now, and should be notified of any new ones.

Minimal Comp Examples?

16 comments

Do you use Minimal Comps? I would love to get a list of sites and apps that feature them. Even if it's just an experiment or proof of concept type example. Leave links in the comments or email me at kp at bit-101 dot com. Thanks!

Minimal Calendar

7 comments

I'm doing a personal project with my Minimal Components and I needed a calendar. So I made one.

Get Adobe Flash player

It's in version 0.98 here: http://code.google.com/p/minimalcomps/. This release also fixes a couple of bugs and adds a couple of features:

- All components now have a "tag" property which is an int. Comes in handy now and then.
- RadioButtons now have a "groupName" property so multiple groups of radio buttons can act independently.

Several people have sent in additional components upgrades and additional features. Most of these have been flagged in my mail app, not totally forgotten. I just looked them over tonight, with the idea that maybe I'd implement some of them, but it's going to take some more digging into the code and testing first. It's not that I don't appreciate what people have contributed, I just really haven't touched these things or put any attention on them in quite a while. And now I'm starting to. I think my priority will be implementing a scroll bar and list type component. I realize it's a big lack.

Oh yay, hacked again.

17 comments

Someone just pointed out that I had an offscreen div with about a jillion spam links. Uploaded a new WordPress install. No luck. Changed the theme, that seemed to do it. Looks like I'm in the market for a new theme. Until then, enjoy the default.

Check your Flash!

no comments

Do you make Flash content? Do you have Flash content on the web? If so, you owe it to yourself and your clients to check this content against the upcoming version 10.1 beta player. There's lots of new goodies in this player, but as you - a developer yourself - know, when you add and change stuff, you risk breaking existing stuff. The Flash player has this problem 1000 times over - it has to run all the existing Flash content created by millions of developers all over the world, and with minimum failure. A lot of testing is done internally obviously, but only you will know if your content runs without any hitches.

So if you haven't already done so, install 10.1 and take your existing or soon to be released content on a spin with it. Hopefully it works fine. You might need to fix a few things on your end, or in the worst case, you might need Adobe to fix something, in which case you should submit a bug report now, before it's too late.

Ted Patrick has more details on what to do and how to do it here.

This also goes for any AIR applications you may have out there. Your users will soon be updating that as well, and you should make sure your apps run well on it.

Programming Art

10 comments

Been a bit quiet around here, eh?

As I mentioned in my New Year's post, I've been kind of taking a break lately. Haven't really been doing much of anything to write about to be honest. Waiting for inspiration to hit me.

Well, it's starting to hit. A few weeks ago, I talked to Shawn Pucknell about speaking at FiTC Toronto. So I needed to come up with a subject to talk about. Up to now, I've almost always done a brand new talk for every conference I've spoken at. Really, the only exceptions are when the organizers explicitly ask me to do a specific talk. But it seems that most speakers are doing the same talk at multiple events these days. Many do the same talk for a year, or a good part of thereof, at every conference they speak at.

I used to be opposed to this idea. I felt like it was lazy. For sure, coming up with a brand new talk and all the slides and examples that go with that, for every conference, sure is a lot more work. But I was talking to a few speakers late last year (specifically Grant and Mario while in Tokyo in November) and started to get a new viewpoint on the subject. These guys are anything but lazy about their presentations. Even though they are doing the same basic talk each time, they are constantly revising and tweaking it based on audience reaction and feedback, pacing, personal experience, new data, etc. Doing the same presentation more than once allows you to get better and better at that presentation. One part didn't go so well? Drop it or change it? Went too long in one section? Figure out how to shorten it. Randomly run across some new graphic or example that is perfect for the subject? Squeeze it in there for next time.

On the other hand, when you do a new talk each time, you get one shot to make it good, and the next time, you're onto something new and get one shot at that.

There's also audience logistics that come into play. Again, I used to think that doing the same talk multiple times would be boring for the audience. But not everyone goes to every conference. If I do a talk in Brighton next year and that's the only place I do it, there are a lot of people who might be very interested in it, but don't happen to be at that conference, and will never hear it. And as for those people who seem to be at every conference, well, once they've seen your talk, they are free for the rest of the year to check out other speakers during your time slots. I know there have been plenty of times for me when there were two or more presentations going on in the same slot that I really wanted to see. I would be unhappy thinking that when I choose to miss one that I was really interested in, that's the last shot I'll ever get to see that particular talk.

So with that said, allow me to introduce my talk for 2010, "Programming Art".

As you may know, in July 2008 I started a site called Art From Code. Algorithmic and generative art has, since I first started programming, been one of my biggest passions. In the old BIT-101 lab, I called them "experiments" but they were really quick and dirty interactive art pieces. Art From Code was an attempt to continue some of that same spirit, but with more focus on static images and less on the code behind them. I know that not providing the code for the pieces, and not making them interactive was a huge negative in many people's eyes, but for me it was somehow very liberating and opened up my creative flood gates for a good six months. Then I got hooked on iPhone programming, and ... well that's another story.

So, while I was trying to figure out what to do next in my extracurricular programming life, one of the options was diving back into art. Another was to do more with games. I find game programming very fascinating. It has many of the same creative aspects as programming art, but in the end, I tend to get much more bogged down into the details of architecture and story line and level creation, and before long even the most exciting game idea becomes a chore to finish. With art it's always fresh. Short iteration times and when you just publish the result, no bug reports!

Anyway, I decided I wanted to do more generative art again, but didn't want to limit myself to just ActionScript and Flash. There were a lot of different tools and frameworks that I knew about and had dabbled with, that I thought would be fun to eventually try out more in depth. Stuff like Processing and Open Frameworks, but also lesser known stuff like Context Free Art, Structure Synth, Nodebox, and Toolbox, among others. I figured, what better time to dig into them but now, when I had nothing else particular going on anyway? And if I based my 2010 talk on them, that would keep me focused on them for quite a while. Enough to get to know each one really, really well by the end of the year. And so, that's what my Programming Art talk will be about. Here's the blurb:

As soon as computers had visual displays or printouts, people were using them to create art. In this presentation we'll take a short look at the history of computer generated art, and a hands-on walk through of several of the available programs and languages used for that purpose today, including Flash, Processing, Structure Synth, NodeBox, Context Free, Open Frameworks, and maybe others.

I'll be debuting the talk at FiTC Toronto in April, most likely doing it at Multi-Mania in Belgium in May, and then again at FlashBelt in Minneapolis in June. Those are the only conferences I've yet committed to speaking at in 2010. If I'm not totally bored with the talk, I don't get rotten fruit thrown at me, and I get invited to speak anywhere else after that, I'll probably do it a few more times.

Out of the talks I've given, one of my own personal favorites was my Art From Code talk at FiTC Amsterdam just about a year ago. I definitely plan to incorporate certain parts of that talk into Programming Art, before exploring the different tools.

I think it's going to be a fun year!

Kindle vs. iPad

15 comments

There's so much I could say about the iPad, particularly being a Flash guy. But I'll stay out of that fray. Whatever will be, will be.

The thing that bugs me about people's reactions to the iPad is when people say it's a Kindle killer. First of all, I'm pretty sure that most of the people saying such things do not own a Kindle. It's a totally different device. Here's where the Kindle wins out:

Battery life: 10 days vs. 10 hours.

Eink: You can shrug this off if you don't have a Kindle, but it does make a difference.

Form factor. This is the biggest one and there are several points I want to make about it. I have a Kindle 2. The iPad is just shy of being the size of two Kindle 2's laid side to side. I can carry my Kindle anywhere in my laptop bag and barely notice it's there. I can pull it out while standing on a crowded subway and very comfortably read it while holding it in a single hand - even with gloves on. The iPad is almost like carrying another small laptop. I wouldn't try to use it standing up on the train or hold it one-handed. I don't think you could realistically hold it and operate the touch screen with a single hand. The Kindle, in its case, is fairly indestructible. The iPad, while being almost twice the size has what seems to be an almost 100% glass surface, without the overall support that your laptop screen has from the rest of its body. I predict a lot of broken screens. I already carry my Mac Book Pro and iPhone to work every day. Would I carry an iPad too? I wouldn't use it at work. As already mentioned, I wouldn't use it on the train or bus unless I was able to snag a seat. I would probably generally leave it at home. Thus, as an eBook reader, it is fairly useless to me.

Connectivity: The Kindle has free 3G service. The iPad has WIFI and fairly expensive 3G paid service.

Content: Kindle taps into Amazon and has 400,000 books available and more coming all the time. iPad I believe has deals with six publishers at this time. Not sure how much of their content is available. If you can't get the book you want on your device, it's useless as a book reader.

So what does the iPad have that's better than the Kindle in terms of it being an eBook reader.

Storage: 16-64 GB vs 2 GB. OK, but do you know how big eBooks are? A quick search of mine reveals that many are less than a single MB. Biggest are less than 5 MB. So my Kindle can hold somewhere between 400 and 2000 eBooks. I think I'm all set with 2 GB.

Display: Color vs. Black and White, and size. Have you opened a book lately? Text in books is 99.99% black and white. Most photos are black and white. Most charts are black and white. Granted, if you are reading a book where the color plates are a vital part of the experience of the book, the iPad wins. But in the vast, vast majority of books, you don't really need a color display. Size is nice, but comes with its own drawbacks as mentioned above. For technical books with charts or diagrams, the larger display is definitely a plus.

In short, the iPad looks to be a pretty cool device, but a pretty crappy eBook reader. If I do get one, it will likely stay at home while I take my Kindle with me. But still, is the iPad "better" than the Kindle? That's like asking if your iPhone is "better" than your wrist watch. Sure, it does a hell of a lot more, but it's a senseless comparison. If you want to tell time, get a watch. If you want an eBook reader, get a Kindle. If you want a phone, media, pocket gaming device, get an iPhone. If you want a larger form factor media and gaming device, get an iPad.

Sadly, I think that despite all my arguments (which make perfect sense, are irrefutable, and are 100% correct ;) ), the iPad could still be a Kindle killer. The iPad is a cool device and most likely many, many people will get them. If I had an iPad, I probably would not be able to justify going out and spending another $259 on another device, JUST to read books, which my iPad already let me do.

It will be interesting to see what Amazon's next move will be. Just a week before the iPad was announced, Amazon revealed the Kindle application developer program. Now you'll be able to make and sell apps that run on the Kindle, and sell them, just like iPhone and iPad apps. I'm not sure where that's going to go. I can imagine there might be a few types of apps well suited to the Kindle. I can foresee a dedicated Instapaper or similar app that could be fantastic. But I can't conceive that there will be thousands of actually useful Kindle apps. At any rate, it's not a move that's going to save the Kindle. What could save it is slashing its price in half. For a bit over $100, the Kindle would be a no brainer.

AdvancED ActionScript 3.0 Animation published in Japan

5 comments

Just before I went out to FiTC Tokyo, I was contacted by Naoki Miyagawa, a translater working for OReilly Japan in Tokyo. He said that he was working on the translation of my book, AdvancED ActionScript 3.0 Animation and had some questions for me. It was pretty cool to be able to say, "Well, as a matter of fact, I'll be in Tokyo next week. Why don't we do lunch?" So in Tokyo, I successfully navigated the subway system solo and got out to OReilly's offices, met with several people working on the book, got some cool Japanese OReilly schwag, and had an awesome lunch.

Today, I got the word that the book has now been published:

It should be in the stores, or you can order it from Amazon:

http://www.amazon.co.jp/ActionScript-3-0アニメーション-―衝突判定・AI・3DからピクセルシェーダまでFlash上級テクニック-Keith-Peters/dp/4873114373/ref=sr_1_2?ie=UTF8&s=books&qid=1264161951&sr=8-2

I don't have a copy in hand yet, but have some on the way. This means a lot to me personally, living in a half Japanese home, having a Japanese extended family, and having Japanese culture a part of my everyday life.