Skip to content

Instantly share code, notes, and snippets.

@thejamulator
thejamulator / PrototypeShieldView.swift
Created October 20, 2025 19:46
Step 1 in a Canvas tutorial drawing a picture of a shield
//
// Copyright (c) 2025 and Confidential to Eric Ford Consulting All rights reserved.
//
import SwiftUI
struct PrototypeShieldView: View {
let darkBlue = Color(red: 0.12, green: 0.12, blue: 0.73)
var body: some View {
Canvas { context, size in
//
// Copyright (c) 2025 and Confidential to Eric Ford Consulting All rights reserved.
//
import SwiftUI
struct PrototypeShieldView2: View {
let darkBlue = Color(red: 0.12, green: 0.12, blue: 0.73)
var body: some View {
Canvas { context, size in
@thejamulator
thejamulator / HighlightedControlPointsView.swift
Created October 21, 2025 17:36
Add all of the quad curves and highlight their control points
//
// Copyright (c) 2025 and Confidential to Eric Ford Consulting All rights reserved.
//
import SwiftUI
struct HighlightedControlPoint: View {
let darkBlue = Color(red: 0.12, green: 0.12, blue: 0.73)
var body: some View {
Canvas { context, size in
@thejamulator
thejamulator / ShieldGradientFillView.swift
Created October 21, 2025 18:54
Fill the shield with a gradient
//
// Copyright (c) 2025 and Confidential to Eric Ford Consulting All rights reserved.
//
import SwiftUI
struct ShieldGradientFill: View {
let darkBlue = Color(red: 0.12, green: 0.12, blue: 0.73)
var body: some View {
Canvas { context, size in
@thejamulator
thejamulator / ShieldView.swift
Created October 21, 2025 20:51
Shield with crossbar and Fleur-de-lis type end ornaments
//
// Copyright (c) 2025 and Confidential to Eric Ford Consulting All rights reserved.
//
import SwiftUI
struct ShieldView: View {
let darkBlue = Color(red: 0.12, green: 0.12, blue: 0.73)
var body: some View {
Canvas { context, size in
@thejamulator
thejamulator / PrototypeSwordView.swift
Created October 22, 2025 20:43
Beginning the sword view, drawing a red reference line
//
// Copyright (c) 2025 and Confidential to Eric Ford Consulting All rights reserved.
//
import SwiftUI
struct PrototypeSwordView: View {
let darkBlue = Color(red: 0.12, green: 0.12, blue: 0.73)
var body: some View {
Canvas { context, size in
@thejamulator
thejamulator / BeginHiltView.swift
Created October 23, 2025 18:27
Start drawing the hilt of the sword
//
// Copyright (c) 2025 and Confidential to Eric Ford Consulting All rights reserved.
//
import SwiftUI
struct PrototypeSwordView: View {
let darkBlue = Color(red: 0.12, green: 0.12, blue: 0.73)
var body: some View {
Canvas { context, size in
@thejamulator
thejamulator / MoreArcsView.swift
Created October 23, 2025 19:14
Connect different sized arcs to make the pommel
//
// Copyright (c) 2025 and Confidential to Eric Ford Consulting All rights reserved.
//
import SwiftUI
struct PrototypeSwordView: View {
let darkBlue = Color(red: 0.12, green: 0.12, blue: 0.73)
var body: some View {
Canvas { context, size in
@thejamulator
thejamulator / FinalSwordView.swift
Created October 23, 2025 22:43
Add the guard, the knuckle bow, and the blade
//
// Copyright (c) 2025 and Confidential to Eric Ford Consulting All rights reserved.
//
import SwiftUI
struct PrototypeSwordView: View {
let darkBlue = Color(red: 0.12, green: 0.12, blue: 0.73)
var body: some View {
Canvas { context, size in
@thejamulator
thejamulator / HiltView.swift
Created October 24, 2025 18:03
The rest of the hilt
let pommelKnobRadius = height * 0.0275
let pommelArcOffset = pommelKnobRadius * 1.5
let sideConnectRadius = pommelKnobRadius * 0.5
let handGripHeight = pommelKnobRadius * 6.0
let handGripXOffset = pommelArcOffset
let handGripTop = top.y + pommelKnobRadius * 2.5
let handGripLeftTop = CGPoint(x: midX - handGripXOffset, y: handGripTop)
var hiltPath = Path()
hiltPath.move(to: CGPoint(x: midX - handGripXOffset, y: handGripTop + handGripHeight))