Blog

  • posted by mark
  • on Oct. 28, 2015

Here’s a snippet for Kivy, which adds functionality to get the widget at a given screen position. It’s probably not the most refined approach in the world but until we can get a proper mouse over event, this seems to work for now.

To use it, simply add it to your App class like:


class TestApp(WidgetPosition, App):
...

and call get_widget_at(pos)

And here’s the code:

class WidgetPosition:
    def get_widget_at(self, pos, node=None):
        x, y = pos

        if not node:
            node = self.root

        for widget in node.children:
            if self._is_over_widget(widget, x, y):
                return self.get_widget_at(pos, widget)

        if ...
  • posted by mark
  • on Feb. 26, 2015
Something that's come up a lot in recent jobs is the need for a basic component to enable inline editing on certain fields inside webpages. This drove me to write a small, reusable JQuery component to do the trick, which I've made available on Github in case anyone else finds it useful. You can grab the code here - https://github.com/mtskelton/jquery-inline-editor - along with some basic usage instructions.
  • posted by mark
  • on Sept. 27, 2014
We're looking for authors of all genres and levels of experience, and stories of all lengths, to collaborate with us on an exciting new interactive e-book platform. We can't release too many details yet, but if you're interested in exploring a new writing platform and seeing your work published across multiple platforms, we'd love to hear from you. Send me an e-mail at sales@software13.co.uk for more information.
  • posted by mark
  • on Sept. 21, 2014
Based on code I originally implemented in C++ using SDL, I've finally gotten around to porting an initial bare version of my universal co-ordinate system to Unity C#. The aim of this is to allow developers to use device independent co-ordinates to place and size their GUI elements, as seen in OpenGL. It provides a co-ordinate system of -1.0 to 1.0 on the X and Y axis, with 0.0x0.0 always being the center of the screen. Feel free to check it out and as always, contributions are more than welcome. https://github.com/mtskelton/unity-ucs
  • posted by mark
  • on June 5, 2014
Autoform is a convenience class used to quickly render forms in a Yii view. It's compatible with YiiStrap (www.getyiistrap.com) and will render fields using TbActiveForm if it's available. It's very much in it's infancy at the moment, and only contains the core functionality we are actually using ourselves, however suggestions and improvements are very much welcome! https://github.com/mtskelton/yii-autoform
  • posted by mark
  • on March 21, 2014
Pleased to announce that I've decided to open source the character conversation and general dialog box engine I've been developing as part of a personal project for Unity 3D. I know there's a lot of existing solutions out there in the asset store, but this one is aimed at games which don't need such a heavyweight solution. There's not too much there at the moment but I'll be adding to it as the project progresses. At present the code is able to render a typing character dialog with optional styling and a background texture ...
  • posted by mark
  • on March 13, 2014
Call it March madness, call it whatever you want, but for a limited time only I'm bringing back my 3 page website deal at a massively reduced price on PeoplePerHour! Get your designs turned in to a beautiful hand coded, fully w3c compliant Wordpress or Joomla based site for a fraction of the normal cost. Find out more below: Wordpress Joomla
  • posted by mark
  • on Jan. 22, 2014
(If you're just looking for the problems and solutions, and not the rant, skip to the bottom) Yesterday was an absolute write off. It was a write off because of my old friend Titanium Appcelerator. Regular readers of this site will know that I have a bit of a love / hate relationship with this product. For the uninitiated, Titanium Appcelerator is a cross platform IDE and toolset that allows for the development of mobile applications using Javascript, and builds for Android, iOS, Blackberry, Tizen and more. It's like PhoneGap, but advertises itself as compiling and optimizing the code ...
  • posted by mark
  • on Dec. 12, 2013
A scenario cropped up recently where I was developing a portable extension module in PHP, designed to be used as a drop in component on various sites, and I came across an issue I've hit a few times before. The problem is, the extension I was developing relied heavily on JQuery, but we couldn't guarantee that JQuery was installed in every site the extension would be used on. Sure, there's a couple of easy ways around this. We could have simply brought up a warning message, stating that JQuery was required for use with this plugin and ...
  • posted by mark
  • on Dec. 12, 2013
I find this requirement is coming up increasingly more often, particularly as various website analysis tools recommend deferring the loading of Javascript elements until after the initial page load and insist on it when testing for mobile devices. So here's a handy little snippet I threw together to do just that. Firstly we need a pure JS function to load a script. This is done by creating a new script element and attaching it at the bottom of the body element. Here's the function:
function loadScript(path, callback) {

    var done = false;
    var scr = document.createElement('script');

    scr.onload ...