1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Mu(pygame zero)とProcessing.pyとProcessingの動作比較

Last updated at Posted at 2024-03-25

Processingユーザから見て、python環境に移行する際の気になる点のメモです。

ウィンドウを開く

Mu.py
WIDTH=800
HEIGHT=600
Processing.py
size(800, 600)
Processing
size(800, 600);

なお、サイズ指定なし(ノーコード)で実行した場合、
「Mu.py」(800,600)のウィンドウが開く。
「Processing.py」(100,100)のウィンドウが開く。
「Processing.java」(100,100)のウィンドウが開く。

フルスクリーン

まず、コードを試す前にフルスクリーンを終了する方法を把握。

「Mac」の場合
control + q
command⌘ + q

「Windows」の場合
Alt + F4

「Mu.py」pygame.display.set_modeを使う。適当にモニタ比に変更される?
「Processing.py」fullScreen()を使う。解像度はOSで変更?OSメニューが残る。
「Processing」fullScreen()を使う。もしくはSHIFT押しながら実行ボタン。解像度はOSで変更?。

Mu.py
import pygame

first = True

def draw():
    global first
    if first:
        screen.surface = pygame.display.set_mode((800, 600), pygame.FULLSCREEN)
        first = False
    screen.draw.circle((480, 300), 300, "white")
Processing:py
def setup():
    fullScreen()
    
def draw():
    background(0)
    noFill()
    stroke(255)
    ellipse(480, 300, 300, 300)
Processing
void setup() {
  fullScreen();
}

void draw() {
  background(0);
  noFill();
  stroke(255);
  ellipse(480, 300, 300, 300);
}

追記:
pygame.FULLSCREENの他に|で追加できる項目。
pygame.DOUBLEBUF
pygame.HWSURFACE
pygame.OPENGL
pygame.RESIZABLE
pygame.NOFRAME

実行ファイル生成

「Mu.py」基本的にできないが、CODONなどを使えばできるかも?
「Processing.py」export application、を使うはずだが、うまく動作しない。環境の問題?
「Processing.java」アプリケーションとして書き出し、を使う。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?