View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide

グリッド落書きで遊ぶ

back

落書きシリーズでござる。




ソースコードを順番にドゥ〜イットしてみてください。
Alt + d ( Cmd + d )




■グリッドで落書き。

ドット・エディタを作るときはこうゆうの必要かも、な〜んて遊んでたら
こうゆうのできちゃっておもろいから・・・・。そんだけっす。

wとscaleの値を変えてみるとおもろい・・・かも。

--------------------------------------------
| fd w scale col nextPt lastPt |
w _ 40.
scale _ 40.
col _ Color black.
[Sensor anyButtonPressed] whileFalse.
fd _ FormCanvas on: Display.
[Sensor yellowButtonPressed] whileFalse: [
	lastPt _ Sensor cursorPoint.
[Sensor redButtonPressed] whileTrue:[
	nextPt _ Sensor cursorPoint.
	nextPt _ nextPt // scale * scale.
	underCol _ fd form colorAt: nextPt.
	nextPt = lastPt ifFalse:[
		underCol = Color black 
			ifTrue: [col _ Color white]
			ifFalse: [col _ Color black]]. 
	fd fillRectangle: (nextPt corner: nextPt + w) color: col.
		lastPt _ nextPt
	]]

--------------------------------------------



画面のお掃除はこれ
--------------------------------------------
Display restore.
--------------------------------------------



そんでもって四角形を丸にしたりすると・・・。だからどうなのよう??

--------------------------------------------
| fd w scale col nextPt lastPt |
w _ 40.
scale _ 40.
col _ Color black.
[Sensor anyButtonPressed] whileFalse.
fd _ FormCanvas on: Display.
[Sensor yellowButtonPressed] whileFalse: [
	lastPt _ Sensor cursorPoint.
[Sensor redButtonPressed] whileTrue:[
	nextPt _ Sensor cursorPoint.
	nextPt _ nextPt // scale * scale.
	underCol _ fd form colorAt: nextPt + (w // 2).
	nextPt = lastPt ifFalse:[
		underCol = Color black 
			ifTrue: [col _ Color white]
			ifFalse: [col _ Color black]]. 
	fd fillOval: (nextPt corner: nextPt + w) color: col.
		lastPt _ nextPt
	]]

--------------------------------------------




画面のお掃除はこれ
--------------------------------------------
Display restore.
--------------------------------------------




下の入力ボックスに書き込んで”add to the page”ボタンで登録出来ます。
修正したい場合はページ左のアイコンの”edit”で出てくる画面で編集可能です。
ページ左のアイコンの”uploads”で画像(JPEG,GIF,PNG)のアップロードもできます。


Saturday, 10 July 2004, 10:57:24 pm
*を表示させるときは*のようにする必要があるみたいですね。 --tak
  • 修正ありがとうございまする。ついつい忘れてしまう・・・(涙)。こうゆう場合はちゃんとチェックしてないときだったりしまする。--thoru

Link to this Page