electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » ChucK programming language
Moving Buttons in MAUI
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [5 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Mon Mar 24, 2008 3:22 am    Post subject: Moving Buttons in MAUI
Subject description: You can move buttons around with the mouse!
Reply with quote  Mark this post and the followings unread

Folks, I got the idea today that it would be cool if we could move MAUI buttons around within their view panels with the mouse, so I gave it a try. It seems to work pretty well except it makes some little ghosts of the button. I did it by simply updating the button position and re-calling the view's .addElement () method. This could be a useful addition to our user interface options with MAUI. Anyway, it was an interesting little experiment. Code attached.


Mouse_MAUI1.ck
 Description:
Test experiment of moving a MAUI button around within it's view panel using the mouse.

Download (listen)
 Filename:  Mouse_MAUI1.ck
 Filesize:  2.23 KB
 Downloaded:  371 Time(s)

Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Mon Mar 24, 2008 3:33 am    Post subject: Reply with quote  Mark this post and the followings unread

This version works a little bit better, so try this one instead of the previous one.


Mouse_MAUI2.ck
 Description:
Slightly improved version of experiment moving MAUI buttons with the mouse.

Download (listen)
 Filename:  Mouse_MAUI2.ck
 Filesize:  2.42 KB
 Downloaded:  343 Time(s)

Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Tue Mar 25, 2008 3:39 am    Post subject: Reply with quote  Mark this post and the followings unread

I added sound to it; the amplitude and freqency of a sinusoid are now controlled by the moving mouse button. You hear ghostly woo-woo sounds as you move the mouse.


Mouse_MAUI3.ck
 Description:
Mouse MAUI: now with sound!

Download (listen)
 Filename:  Mouse_MAUI3.ck
 Filesize:  2.66 KB
 Downloaded:  321 Time(s)

Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Tue Mar 25, 2008 12:36 pm    Post subject: Reply with quote  Mark this post and the followings unread

I took the hint from Kassen on the ChucK-Users mailing list, and expanded the program to be a Pong game. Actually it's more like Breakout because the paddle is at the bottom of the window.

If you hit the moving button with the paddle, you get a point when it reaches the top. If you miss the moving button, the ball travels off the window and ChucK gets a point.

It still has the ghostly sound that is a function of ball position, plus I added a click for each bounce and a whoop-whoop-whoop when ChucK scores.

Ah, Pong, what a trip down memory lane!


Pong1_Image.jpg
 Description:
MAUI Pong screenshot, how cool is that?
 Filesize:  16.82 KB
 Viewed:  3505 Time(s)

Pong1_Image.jpg



Pong1.ck
 Description:
MAUI Pong source code, it's ChucK gone mad!

Download (listen)
 Filename:  Pong1.ck
 Filesize:  5.45 KB
 Downloaded:  345 Time(s)

Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Tue Apr 01, 2008 12:57 am    Post subject: Reply with quote  Mark this post and the followings unread

I've improved the Pong game a bit. The ball is now an LED that changes color each time it bounces. The screen is taller and narrower for that multi-bounce effect. And most notably the game gets more difficult as time goes on. The paddle gets smaller and the ball gets faster. Fun, fun, fun!


Pong2.ck
 Description:
New better MAUI Pong - get it now!

Download (listen)
 Filename:  Pong2.ck
 Filesize:  6.4 KB
 Downloaded:  342 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [5 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use