-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|723|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-




spinal

OSX Dock style menu

27th January 2025

Turns out, if you ask copilot enough over a couple of hours, you can get quite close in python...
[code]
import tkinter as tk
from PIL import Image, ImageTk
# Constants
ICON_SIZE = 40
MAX_SIZE = 128
MOUSE_RANGE = 175
SCALE_MAX = MAX_SIZE / ICON_SIZ*snip*


spinal

OSX Dock style menu

27th January 2025

Got the mouse pointer moving correctly, but then I realised, I can't make a transparent window in Blitz3D. I'll be giving up on this then.
[code]
Graphics3D 800, 600, 32, 2
Global screenWidth = 800
Global screenHeight = 600
Global iconSize# = *snip*


spinal

OSX Dock style menu

27th January 2025

Loads a 128x128 image, displays it in the centre of the screen. It turns out that the sacle of the sprites are directly related to the width of the window, no wonder I couldn't scale it properly.
Anyway, this example changes the window size with space*snip*


spinal

OSX Dock style menu

27th January 2025

Trying to do this in 3d...
How on earth do you get a sprite to be 100% scale when rendered?
[code]
Graphics3D 850, 400, 32, 2
texture = LoadTexture(''cover.bmp'') ; 128x128 image
; Get the texture resolution
TextureWidth# = TextureWidth(textu*snip*


spinal

Scrolling tiles

6th January 2025

I was WAY over thinking it. started over, used an array for the text and plotted from the top of the screen instead of the clipboard graphic.
[code]

; Top corner of clipboard
ps = pixelScale
cx = ((SCREENWIDTH/2)-(ImageWidth(bigClipboard)/2)) / p*snip*


spinal

Scrolling tiles

4th January 2025

AAAAAAAAAAAAAAAAAARRRRRRRRRRRRRRRRRGGGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!11111111111111
[code]
Function creditsScreen()

; Top corner of clipboard
cx = (SCREENWIDTH/2)-(ImageWidth(bigClipboard)/2)
cy = SCREENHEIGHT-ImageHeight(*snip*


spinal

Scrolling tiles

29th October 2024

I meant codewise like this...
[code]
Function newDialog$()

oldDialog$ = current_dialog$

isSafe = False

While isSafe = False

dialog_line = Rand(2) ; waight the negative a little


If dialog_line <=1 Then ; Negative
wh*snip*


spinal

File/Folder browsing in Blitz3D...

22nd May 2024

I used this for a basis for something I'm working on, so before I start adding all sorts of crap to it, I'll post the minor changes I made.
[code]
Global HEIGHT = 768
Global WIDTH = 1024
Graphics(WIDTH, HEIGHT, 0, 2)
AppTitle ''Designer&qu*snip*


spinal

Scrolling tiles

4th May 2024

I dont suppose anyone can see why this is missing the last word in the string?
[code]
Global word_count = 0
Global dialog_word = 0
Global string_pos
Global dialog_tx = 0
Global dialog_ty = 0
Global dialog_stx = 0
Global dialog_sty = 0
Function dia*snip*


spinal

Scrolling tiles

8th March 2024

Because my method involves upscaling by hand, using writepixelfast turns out to be slower (more loops), so my method is good enough for my use case.
[code]
Function grabBackground(x, y)
pauseSprite = CreateImage (160*pixelScale, 128*pixelScale)
MaskI*snip*


spinal

Scrolling tiles

2nd March 2024

Came back to it later.... I was thinking about it all wrong.
[code]
Function renderLevel()
Local scrollX = (player\\x + (TILESIZE/2)) - ((SCREENWIDTH/SCREENSCALE)/2)
Local scrollY = (player\\y + (TILESIZE/2)) - ((SCREENHEIGHT/SCREENSCALE)/2)
Local XT*snip*


spinal

Scrolling tiles

29th February 2024

It's been a little while since I tried this and I seem to have it all backwards. I can't get my brain to go in the right direction.
2024/09/Game_01_fail (.zip)
I think its mostly the render function that's wrong, but it might be more. I'm*snip*


spinal

ball physics?

19th December 2023

Been trying to get chatgpt to convert this (Linkage) to blitz3d...
[code]
Graphics3D 800, 600, 32, 2
Const W = GraphicsWidth()
Const H = GraphicsHeight()
Global numBalls = 30
Global gravX = 0
Global gravY = -0.1
Type Ball
Field x
Field y
*snip*


spinal

N64 Controller Project...

8th September 2023

Modded the code a little for potential speed ups, only by removing function calls to abs().
[code]
#define xPin A2 // select the input pin for the potentiometer
#define yPin A1 // select the input pin for the potentiometer
#define XA 6
#define*snip*


spinal

N64 Controller Project...

8th September 2023

OK, I dug out the arduino code, but I didn't comment it very well so I have gone and forgot that the hell the offset value does...
I'm tempted to think its the difference between the full stick value and the 'correct' full stick value...
*snip*


spinal

SpinalWatch

27th August 2023

OK, got that working as far as I can tell. Now to re-arduino the code.
(Image.png)
[code]
Graphics 320,240,0,2
Global gScale = 1
Global WIDTH = 144
Global font02 = LoadAnimImage(''font.png'', 11, 15, 0, 96)
Dim fWidth(96)
For t = 0 To 95 *snip*


spinal

SpinalWatch

26th August 2023

OK, got the blitz version up to the same problem. I switched to blitz because uploading code to the arduino, then sending myself an sms message is a slow process, wheras hitting F5 is nice and fast.
What I WANT to happen, is that if a single word is too w*snip*


spinal

SpinalWatch

26th August 2023

Here is an attempt in blitz, it nearly works...
font.png
(Image.png)
[code]
Graphics 320,240,0,2
Global WIDTH = 144
Global font02 = LoadAnimImage(''font.png'', 11, 15, 0, 96)
Dim fWidth(96)
For t = 0 To 95
Read fWidth(t)
Next
Rect 0,0*snip*


spinal

SpinalWatch

26th August 2023

This is just getting longer and longer, and still not right.
[code]
void print(int x, int y, const char* text) {
int x1 = x;
int fHeight = 0;
int nextSpace = 0;
uint8_t numChars = strlen(text);
const char* wordStart = text; // Pointer to *snip*


spinal

SpinalWatch

19th August 2023

It's weird, I would manually force the buffer and the copy to be different, but then it would only decide that where I'd put the text was different and the background wouldn't be.
I was calling clearSceeenBuffer() in my setup, so I'd expec*snip*


spinal

SpinalWatch

18th August 2023

OK, Started from scratch, First I got the BLE code working and connecting, no problems yet.
Then I added all of the power saving code, one item at a time and still working (power at 1.9mA).
Left it running for a while, no crashing, sent multiple notifica*snip*


spinal

SpinalWatch

15th August 2023

[code]
inline void drawPixel(int x, int y, uint8_t color){
if(x<0 || y<0 || x>=WIDTH || y>=HEIGHT) return;
uint16_t x8 = x>>3;
if(color > 1){
color = GreyPattern[(x&1)+2*(y&1)];
}
if (color){
sBuff[x8 *snip*


spinal

SpinalWatch

12th August 2023

OK, after leaving it running a while, removing an y code that 'does anything' with the received messages, so my function now looks like this...
[code]
void getMessages(){
bleSerial.poll();
while (bleSerial.availableLines() > 0) {
ch*snip*


spinal

SpinalWatch

12th August 2023

Didn't help, this time it crashed after maybe 12 hours?
Added a RAM counter...
[code]
// quick function to find free memory, it's slow though
long unsigned int freeMem = 0;
long unsigned int availableMemory() {
int size = 128*1024; // We ha*snip*


spinal

SpinalWatch

26th July 2023

Turns out it needs a full stop at the end...
[code]
{t:''info'', msg:'Hello World'}.
[/code]
There doesn't seem to be much I'd need to tell the app, but it looks like dismissing notifications or calls will be possible.

More - Older Posts