• Unlikely Objects
  • Ludography
    • Nonoku
    • Acquisition
    • Image Mark Up
  • About
Menu

Unlikely Objects

  • Unlikely Objects
  • Ludography
  • Pint Sized Planet
    • Nonoku
    • Acquisition
    • Image Mark Up
  • About

Nonoku - Coloured Buttons

November 29, 2016

The eternal question when writing from a coder’s perspective, UK English, or US English, spelling. Context seems important to me. Mostly I will spell using US English standards since that’s the environment I’m coding in (Color, Center, Synthesize). When writing documentation, except when specifically referencing code, I’ll default to UK English (Colour, Centre, Synthesise). In an IDE it’s hard to type the UK English variant, in a document editor, it’s hard to type the US English spelling. Maybe it’s purely contextual and if I was updating a document that was in US English I’d automatically switch. I certainly find that with the minor differences between Windows and OS X keyboard layouts when I switch between them.

Anyway… More buttons. These ones are in the game itself and allow the selection of different colours to fill in the puzzle. It automatically scales to allow different numbers of colours. Eight seems to be the upper practical limit for fitting them into the UI.

More PaintCode shenanigans. I’ve also got Telekinesis working. I’m not really doing anything fancy enough to warrant it but it’s fun to play with a little. These buttons are two separate elements. One rounded rectangle that I can scale whilst maintaining the aspect ratio, and the circular ‘button’ part which has an inner shadow (as a highlight) and an outer shadow to give it a little depth. The highlight and the shadow are set according to the colour of the button. Not being familiar with PaintCode, I tried doing it as a single element. Since I needed different scaling that proved tricky. I got close with the Frames and Constraints but it wasn’t quite right. In the end, it was faster (and more logical) to split it out into separate pieces.

And yes, I am procrastinating on the next part. I need to add the game part of this game. I mostly have the shape of it in my head and I’ve messed with a couple of implementations but I’m waiting for it to feel right before I commit to something.

On an iPhone 5, just about enough room, with a little tweaking. However, loads of room below so maybe two separate rows on a phone would work,,,

On an iPhone 5, just about enough room, with a little tweaking. However, loads of room below so maybe two separate rows on a phone would work,,,

On the iPad, only enough vertical space for a single row but horizontally it's fine.

On the iPad, only enough vertical space for a single row but horizontally it's fine.

In An Evening of Code, Games Tags iOS, nonoku, game, indiedev, xcode, paintcode
Comment

Nonoku - Buttons

November 28, 2016

Real life caught up so only a little progress. Started experimenting with some graphics tools just to change things up. Nothing final yet but this was quick enough to implement. I used PaintCode to draw out the button and add a gradient fill I could swap with the flat background by setting a flag. Then all I had to do was create a custom UIControl to draw the button.

The text is defined at run-time so could be localised in future if I stick with this style.

override func draw(_ rect: CGRect) {
    NonokuKit.drawMenuButton(frame: bounds, tapped: tapped, text: text)
}

So simple it's barely even worth including.

In An Evening of Code, Games Tags nonoku, paintcode, xcode, iOS, indiedev, Pint Sized Planet
Comment

Latest

Unlikely Objects
Fractal Plant in Godot
about a year ago
Binary Tree in Godot
about a year ago
Sierpinski Triangle in Godot
about a year ago
Re-visiting some old code
about a year ago
React - Starting a New Project
about 3 years ago
Satsuma Tosser
about 4 years ago
1HGJ #002: Deeper and Deeper
about 7 years ago
1HGJ #001: Telekinetic Bomberman Rush
about 7 years ago
Migrating to NSPersistentContainer
about 7 years ago
Nonoku - SpriteKit Shader
about 7 years ago

Powered by Squarespace