Discuss Scratch
- 50_scratch_tabs
-
1000+ posts
desktop buddy
I know how to do it in Python but I don't have my PC right now.(#18)i want a moving buddy
Just use a paint editor to add it to your desktop image.
King of page no edit
- snoopythe3
-
500+ posts
desktop buddy
guys im kinda busy so dont expect me to respond instantly when you make a forum post ok
- TheAutocorrectingCat
-
1000+ posts
desktop buddy
No experienced forumer expects anyone to respond instantly. guys im kinda busy so dont expect me to respond instantly when you make a forum post ok
- 8to16
-
1000+ posts
desktop buddy
I made a functional mockup, will share it later because i had to make it on windows (due to differences in the tk toolkit for windows and linux)
- glitcX
-
1000+ posts
desktop buddy
You should make it a project I made a functional mockup, will share it later because i had to make it on windows (due to differences in the tk toolkit for windows and linux)
bc i can't see it :P
- scratchcode1_2_3
-
1000+ posts
desktop buddy
(#24)WHAT THE HECK YOU BEAT ME TO IT I JUST MADE IT ON PYTHON WITH PyQt AND MADE IT WALK AROUND WITH MEOW.WAV I JUST COULDN'T GET THE TEXT TO WORK BECAUSE OF THE DUMB SELF.TEXT_LABEL NOT WORKING RAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
I made a functional mockup, will share it later because i had to make it on windows (due to differences in the tk toolkit for windows and linux)












- scratchcode1_2_3
-
1000+ posts
desktop buddy
(#25)there is none yet, 8to16 said it will be shared laterYou should make it a project I made a functional mockup, will share it later because i had to make it on windows (due to differences in the tk toolkit for windows and linux)
bc i can't see it :P
- 8to16
-
1000+ posts
desktop buddy
(#26)my mockup is more static tho, it can't walk because i don't know how to change images in tkinter(#24)WHAT THE HECK YOU BEAT ME TO IT I JUST MADE IT ON PYTHON WITH PyQt AND MADE IT WALK AROUND WITH MEOW.WAV I JUST COULDN'T GET THE TEXT TO WORK BECAUSE OF THE DUMB SELF.TEXT_LABEL NOT WORKING RAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
I made a functional mockup, will share it later because i had to make it on windows (due to differences in the tk toolkit for windows and linux)
anyways mine has a context menu
will share image when i boot to linux (i don't have my cubeupload password saved on windows)
- alpha_ape_13
-
500+ posts
desktop buddy
Very much unnecesary for the primary coding aspect. But this would be very cool! even though this will give me nightmares and scratch my computer at 3am
Last edited by alpha_ape_13 (Nov. 24, 2024 01:54:33)
- DifferentDance8
-
1000+ posts
desktop buddy
Massive support! I love desktop buddies in general as it's such a cool concept for a program (I only actually used two of them - Desktop Crewmate and Desktop Goose - and I saw a video of PAICom but not prepared to spend 5 dollars for it but that's a discussion for another day and another part of the website that aren't the forums, as this is about a specific one being suggested).
this is probably my second most yappiest paragraph of all time, which goes to show how my autism is willing to write at length for stuff it's interested in to the detriment of the people reading this post.
The only problem is scope, A.K.A “what stuff is essential for a desktop buddy, which stuff isn't but is a neat feature to have and which stuff would be cool but just kinda weird?” Desktop buddies come in different shapes and sizes, from the relative uselessness of D-PET pets all the way to something like BonziBuddy which (despite being spyware) also acts as essentially a Siri before Siri was even a thing. So it's nice to have some kind of ground scale
this is probably my second most yappiest paragraph of all time, which goes to show how my autism is willing to write at length for stuff it's interested in to the detriment of the people reading this post.
The only problem is scope, A.K.A “what stuff is essential for a desktop buddy, which stuff isn't but is a neat feature to have and which stuff would be cool but just kinda weird?” Desktop buddies come in different shapes and sizes, from the relative uselessness of D-PET pets all the way to something like BonziBuddy which (despite being spyware) also acts as essentially a Siri before Siri was even a thing. So it's nice to have some kind of ground scale
Last edited by DifferentDance8 (Nov. 24, 2024 05:36:18)
- WindowsAdmin
-
1000+ posts
desktop buddy
Like it's really just a useless thing, like it's cool and all, but if it just sits there, says “Scratch 3.0 was released in 2019” and draws on your screen i don't think the scratch team would put the time it takes to do this
- DifferentDance8
-
1000+ posts
desktop buddy
It could also remind you of your latest notification Like it's really just a useless thing, like it's cool and all, but if it just sits there, says “Scratch 3.0 was released in 2019” and draws on your screen i don't think the scratch team would put the time it takes to do this
- WindowsAdmin
-
1000+ posts
desktop buddy
(#32)adding browser notifications would be way simplerIt could also remind you of your latest notification Like it's really just a useless thing, like it's cool and all, but if it just sits there, says “Scratch 3.0 was released in 2019” and draws on your screen i don't think the scratch team would put the time it takes to do this
- 8to16
-
1000+ posts
desktop buddy
alright here's the mockup

it has a menu to go to the scratch homepage, or close the desktop buddy
will make an animated mockup when i can

it has a menu to go to the scratch homepage, or close the desktop buddy
will make an animated mockup when i can
Last edited by 8to16 (Nov. 25, 2024 11:59:46)
- hydrofungus
-
1000+ posts
desktop buddy
eh i don’t use a computer but sounds okay enough
he needs to move around if he can
he needs to move around if he can
- DifferentDance8
-
1000+ posts
desktop buddy
And he will. The only desktop buddy I know which is stationary is PAICom which is really obscure anyway. he needs to move around if he can
- snoopythe3
-
500+ posts
desktop buddy
I hope this medium article will help. https://medium.com/analytics-vidhya/create-your-own-desktop-pet-with-python-5b369be18868
- Maximouse
-
1000+ posts
desktop buddy
This is an interesting idea, but I don't think there's a reason for this to be an official thing made by the Scratch Team. Since you already implemented it, why not publish the code somewhere and let others contribute to add the features you want?
- 8to16
-
1000+ posts
desktop buddy
(#38)ok here.
This is an interesting idea, but I don't think there's a reason for this to be an official thing made by the Scratch Team. Since you already implemented it, why not publish the code somewhere and let others contribute to add the features you want?
buddy.py
import tkinter as tk from PIL import Image, ImageTk from pygame import mixer import webbrowser from time import sleep # Meow sound mixer.init() meow = mixer.Sound("Meow.wav") meow2 = mixer.Sound("Meow2.wav") pop = mixer.Sound("pop.wav") # Functions to handle dragging def start_drag(event): global x_offset, y_offset x_offset = event.x y_offset = event.y meow2.play() def drag_window(event): x = event.x_root - x_offset y = event.y_root - y_offset root.geometry(f"+{x}+{y}") # Function to show speech bubble def show_speech_bubble(text): speech_bubble = tk.Toplevel(root) speech_bubble.overrideredirect(True) speech_bubble.attributes('-topmost', True) label = tk.Label(speech_bubble, text=text, bg="white", fg="black", bd=2, padx=5, pady=5, relief="solid") label.pack() # Position the speech bubble bubble_x = root.winfo_x() + 50 # Adjust as needed bubble_y = root.winfo_y() - 50 # Adjust as needed speech_bubble.geometry(f"+{bubble_x}+{bubble_y}") # Play sound meow.play() # Auto-remove the speech bubble after a few seconds root.after(3000, speech_bubble.destroy) # Create the main window root = tk.Tk() # Remove the title bar root.overrideredirect(True) # Make the window always on top root.attributes('-topmost', True) # transparency root.wm_attributes("-transparentcolor", "darkgray") # Load the image (replace 'buddy.png' with your image file) image = Image.open("ScratchBuddy.png") photo = ImageTk.PhotoImage(image) # Create a label to hold the image label = tk.Label(root, image=photo, bg='darkgray') label.pack() # Bind mouse events to the functions label.bind("<Button-1>", start_drag) label.bind("<B1-Motion>", drag_window) # Schedule the speech bubble to show 2 seconds after startup root.after(500, lambda: show_speech_bubble("Meow!")) def scratch(): webbrowser.open("https://scratch.mit.edu") def bye(): pop.play() root.destroy() sleep(0.3) exit() m = tk.Menu(root, tearoff = 0) m.add_command(label ="Scratch Website", command=scratch) m.add_command(label ="Goodbye", command=bye) def do_popup(event): try: m.tk_popup(event.x_root, event.y_root) finally: m.grab_release() label.bind("<Button-3>", do_popup) # Position the window (can be adjusted as needed) root.geometry("+300+300") # Run the application root.mainloop()
- scratchcode1_2_3
-
1000+ posts
desktop buddy
(#39)hey i made some too(#38)ok here.
This is an interesting idea, but I don't think there's a reason for this to be an official thing made by the Scratch Team. Since you already implemented it, why not publish the code somewhere and let others contribute to add the features you want?
buddy.pyassets: ScratchBuddy.png, Meow.wav, Meow2.wav, pop.wavimport tkinter as tk from PIL import Image, ImageTk from pygame import mixer import webbrowser from time import sleep # Meow sound mixer.init() meow = mixer.Sound("Meow.wav") meow2 = mixer.Sound("Meow2.wav") pop = mixer.Sound("pop.wav") # Functions to handle dragging def start_drag(event): global x_offset, y_offset x_offset = event.x y_offset = event.y meow2.play() def drag_window(event): x = event.x_root - x_offset y = event.y_root - y_offset root.geometry(f"+{x}+{y}") # Function to show speech bubble def show_speech_bubble(text): speech_bubble = tk.Toplevel(root) speech_bubble.overrideredirect(True) speech_bubble.attributes('-topmost', True) label = tk.Label(speech_bubble, text=text, bg="white", fg="black", bd=2, padx=5, pady=5, relief="solid") label.pack() # Position the speech bubble bubble_x = root.winfo_x() + 50 # Adjust as needed bubble_y = root.winfo_y() - 50 # Adjust as needed speech_bubble.geometry(f"+{bubble_x}+{bubble_y}") # Play sound meow.play() # Auto-remove the speech bubble after a few seconds root.after(3000, speech_bubble.destroy) # Create the main window root = tk.Tk() # Remove the title bar root.overrideredirect(True) # Make the window always on top root.attributes('-topmost', True) # transparency root.wm_attributes("-transparentcolor", "darkgray") # Load the image (replace 'buddy.png' with your image file) image = Image.open("ScratchBuddy.png") photo = ImageTk.PhotoImage(image) # Create a label to hold the image label = tk.Label(root, image=photo, bg='darkgray') label.pack() # Bind mouse events to the functions label.bind("<Button-1>", start_drag) label.bind("<B1-Motion>", drag_window) # Schedule the speech bubble to show 2 seconds after startup root.after(500, lambda: show_speech_bubble("Meow!")) def scratch(): webbrowser.open("https://scratch.mit.edu") def bye(): pop.play() root.destroy() sleep(0.3) exit() m = tk.Menu(root, tearoff = 0) m.add_command(label ="Scratch Website", command=scratch) m.add_command(label ="Goodbye", command=bye) def do_popup(event): try: m.tk_popup(event.x_root, event.y_root) finally: m.grab_release() label.bind("<Button-3>", do_popup) # Position the window (can be adjusted as needed) root.geometry("+300+300") # Run the application root.mainloop()
import sys from PyQt5.QtCore import Qt, QTimer from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets import QApplication, QLabel from playsound import playsound import random class DesktopBuddy(QLabel): def __init__(self): super().__init__() self.phrases = ["Hello!", "I'm Scratch Cat!", "MEOW", "Yay!"] self.pixmap = QPixmap("scratch_cat_walk1.png") self.setPixmap(self.pixmap) self.setWindowFlags(Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint) self.setAttribute(Qt.WA_TranslucentBackground) self.setFixedSize(self.pixmap.size()) self.show() self.timer = QTimer(self) self.timer.timeout.connect(self.move_buddy) self.timer.start(100) self.dx, self.dy = 5, 0 self.speech_timer = QTimer(self) self.speech_timer.timeout.connect(self.say_something) self.speech_timer.start(10000) def say_something(self): try: if hasattr(self, 'text_label') and self.text_label.isVisible(): self.text_label.hide() random_phrase = random.choice(self.phrases) self.text_label = QLabel(random_phrase, self) self.text_label.setAlignment(Qt.AlignCenter) self.text_label.setStyleSheet(""" background-color: rgba(0, 0, 0, 200); color: white; font-size: 90px; padding: 5px; border-radius: 5px; """) self.text_label.adjustSize() geometry = self.geometry() self.text_label.move(geometry.center().x() - self.text_label.width() // 2, geometry.top() - self.text_label.height() - 10) self.text_label.show() print(f"Text: {random_phrase}, Position: ({geometry.center().x() - self.text_label.width() // 2}, {geometry.top() - self.text_label.height() - 10})") QTimer.singleShot(3000, self.text_label.hide) playsound("Meow.wav") except Exception as e: print(f"Error in say_something: {e}") def move_buddy(self): x, y = self.x(), self.y() self.move(x + self.dx, y + self.dy) if x <= 0 or x + self.width() >= QApplication.primaryScreen().size().width(): self.dx *= -1 if y <= 0 or y + self.height() >= QApplication.primaryScreen().size().height(): self.dy *= -1 def mousePressEvent(self, event): if event.button() == Qt.LeftButton: self.drag_pos = event.globalPos() def mouseMoveEvent(self, event): if event.buttons() == Qt.LeftButton: self.move(self.pos() + event.globalPos() - self.drag_pos) self.drag_pos = event.globalPos() app = QApplication(sys.argv) buddy = DesktopBuddy() sys.exit(app.exec_())