Wednesday, 17 September 2008

Wallpaper!


A sneak peak at one of my wallpaper designs for ShinyPic. I hope David manages to find a nice way of getting a nice customisable interface :P. I am after all obsessed with graphics and the visual element of things. I may post a few more designs closer to the first release or I may just let you discover them if they are included.

This wallpaper was made in Blender (http://www.blender.org), I made some nice blue shapes and then messed the hell outta them with blenders awesome nodes. I may make a tutorial on messing with nodes sometime (probably wont) for anyone who has an interest. Meanwhile I gotta go for now and sleep on some wallpaper ideas.

Tuesday, 16 September 2008

And then... there was a loading bar!


This turned out to be incredibly easy to code, and so only really took me about 30 minutes. It's displayed every time you select a different directory to view images from, and gives a much better visual representation of the loading process than the old system did (where it printed the name of the image being loaded to the separate command-line window). At the moment, it moves up by the same amount for every image, but soon I'll make it so that larger images cover a greater amount of bar-space than smaller images (so that it's more accurate). Much thankingness to James for making the bar image!

Monday, 15 September 2008

Building a Basic Browser

Having almost completed the full-size viewer, I decided now would be a good time to start work on the directory picker (for selecting a directory to load images from). So far, I've made pretty good progress - you can browse directories by clicking to open a folder, or clicking "Move up" to move up a directory. Right-clicking on a folder selects it, and makes the program close the browser and load up the images from inside the folder. However, it's not all that aesthetically pleasing yet, as you'll see from the screenshot:


Don't worry though, as I'm hoping to polish it's appearance over the next few days, so soon it will be shiny.

More pressing are the bugs; for example, if a folder's name is too long it will go right of the edges of the window. Also, if a directory you're viewing has more than around 40 folders in it, many of them will be off the bottom of the screen - I'll be needing to implement some form of scrolling to resolve this. Both bugs are entirely fixable however, so we should be seeing the browser complete by the end of the week.

Sunday, 14 September 2008

Panning works, and I don't know why.

So there I was, hacking away at the keyboard, trying to make magic happen on-screen. Every approach I tried for panning gave incredibly strange results, often causing the image to fly off-screen as soon as I moved the mouse. My Slipslide 2 menu / ShinyPic grid view formula simply didn't want to work in this particular situation.

Irritated, I decided to slam out a quick death-or-glory mess to see what would happen. Well, it started fairly neat and orderly, but as I typed I kept thinking of random things to put in, and so the line got longer and longer and ended up with at least ten nested layers of brackets. Sniggering, I did a quick test run to see how buggered it would be.

And guess what? The code ran perfectly, and the panning was smooth and precise. It is at times like these where my usual response, "Oh shit", simply doesn't cover the magnitude of the situation. After a few seconds of pondering what to do instead, I opted for a more obscene word. Sadly, this was to no avail as pronunciation becomes somewhat impossible when your jaw is lost somewhere on the floor behind the computer-related spaghetti heap.

I have to say, this speaks volumes of my subconscious' programming skills. I never could have done it,anyway. Behold the majestic solution proposed by an unknown entity hiding somewhere within the back of my mind:

mouseoffsetx = ((float(self.screen.get_width()) / 2.0) - float(mousepos[0]))

centrex = (float(self.screen.get_width()) / 2.0) + (mouseoffsetx * ( ((float(self.scaledimage.get_width()) - float(self.screen.get_width()) ) / 2.0) / (float(self.screen.get_width() / 2.0) ) ))

mouseoffsety = ((float(self.screen.get_height()) / 2.0) - float(mousepos[1]))

centrey = (float(self.screen.get_height()) / 2.0) + (mouseoffsety * ( ((float(self.scaledimage.get_height()) - float(self.screen.get_height()) ) / 2.0) / (float(self.screen.get_height() / 2.0) ) ))


Ridiculous, no? Well, now I have to try and work out why that stuff works. If I'm not back in five months' time, send in a search party.

Getting closer...

The first release of ShinyPic is drawing ever nearer; all that remains is to add panning to the full-size viewer and add a way of letting the user choose a folder to load images from.

However, the former is turning into a major challenge as my standard mouse-scroll-system, which I used not only on the tile view but on the Slipslide 2 main menu, is causing strange glitches such as the image being drawn a good thirty pixels to left of where it probably should be. I'm thinking this is probably due to me using it to calculate the wrong position - the image centre position and the actual draw position are easy to confuse here.

With any luck, I'll get it fixed today and then start thinking about the latter of the two objectives: loading from a user-specified folder. For this, I may need to develop some sort of folder browser which is opened when the user clicks a button; however, I'm not certain how the browser will work or where to place the button. A few minutes ago I had the 'brilliant' idea of placing it at the same side as the text and keep it on the opposite side of the screen to the mouse so that it can never obscure any images, but this fantastic approach fell flat on its face seconds later when I realised that the user would therefore never be able to click it. So it's back to the drawing board on that one.