if (match) {
let x = parseFloat(match[1]);
let y = parseFloat(match[2]);
if (key === 'ArrowUp') {
y -= 10;
} else if (key === 'ArrowDown') {
y += 10;
} else if (key === 'ArrowLeft') {
x -= 10;
} else if (key === 'ArrowRight') {
x += 10;
}
(½,0)⨁(0,½) (OP) replied with this 2 years ago, 55 minutes later, 1 hour after the original post[^][v]#1,229,269
here's a python function that takes a textfile as input and displays X number of lines, Y number of characters and scrolls Z number of lines per second and animates scrolling text for T seconds in a new popup window and saves the output as an AVI file
import pygame
import sys
import time
import numpy as np
import cv2
def draw_text(lines, start_line, X, Y):
for i in range(X):
if start_line + i < len(lines):
line = lines[start_line + i][:Y]
text = font.render(line, True, TEXT_COLOR)
screen.blit(text, (0, i * font.get_height()))
def animate_textfile(filename, X, Y, Z, R):
with open(filename, 'r') as file:
file_lines = [line.rstrip() for line in file]
# Capture frame for the video
frame = np.frombuffer(pygame.surfarray.array3d(screen).data, dtype=np.uint8)
frame = frame.reshape((SCREEN_HEIGHT, SCREEN_WIDTH, 3))
video.write(frame)
clock.tick(FPS)
video.release()
pygame.quit()
filename = 'pygameavi.py'
X = 80 # Number of lines to display at once
Y = 80 # Number of characters per line
Z = 2 # Lines scrolled per second
R = 10 # Duration of the animation in seconds
(½,0)⨁(0,½) (OP) double-posted this 2 years ago, 3 minutes later, 2 hours after the original post[^][v]#1,229,270
@1,229,265 (Phatthew Phosteet Philler)
pardon? i turned it into an asteroid game and just put the AVI on to youtube. it fires lasers, blows up asteroids, and has a Klingon battle ship trying to kill you before you make it back to earth. it's like a race.
(½,0)⨁(0,½) (OP) replied with this 2 years ago, 1 hour later, 6 hours after the original post[^][v]#1,229,301
@previous (G)
i was watching this one, i hadn't thought of using GPT to draw .svgs and tried the .avi prompt to see the difference in gpt4 with safety features compared to the demo. had no problem. i also told it to add a starfield behind the enterprise svg with opposite motion and parallax star behavior. pretty dope.
@1,229,287 (E)
hi kook. well, 20 minutes from asking it to draw the enterprise to having inertial motion, free yaw translation, and 3 layer depth of field parallax background starfield motion.
how much did it cost brie for you to sit on your fat ass all day and make fun of transgenders this month so far? none of my business probably.
but it's clear how much time you waste on your life.
doing nothing.
@1,229,291 (F)
this is me pretending to not interact with you following me thread to thread to thread to thread.