Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Rectangle & Ellipse Module in Ruby

Post any examples or modules that you want to share here

Rectangle & Ellipse Module in Ruby

Postby chackl » Wed Aug 21, 2013 8:50 pm

Hello!

Today a was making some GUI in ruby and as a "Lession" i did a port of the old Rectangle & Ellipse Modules from Synthmaker V3 / FlowStone V2
rect&ell.png
rect&ell.png (112.4 KiB) Viewed 30705 times


As you see i also did properties for config

What is new is the Hatch-Brush.

If you have any ideas for updates/upgrades please write here ;)

Base-Module - Free4Use in any Project.

For all Ruby nerds - please take a look how i did port all variables from te properties to the main module - maybe there is a better solution - if someone could do that ;)


Best Regards
Attachments
rect&ell_v1.1.fsm
(5.32 KiB) Downloaded 1285 times
Last edited by chackl on Tue Nov 05, 2013 3:46 pm, edited 1 time in total.
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
User avatar
chackl
 
Posts: 233
Joined: Tue Aug 17, 2010 8:46 pm
Location: Austria / Salzburg

Re: Rectangle & Ellipse Module in Ruby

Postby Jay » Wed Aug 21, 2013 9:15 pm

very nice m8! cheers for these they will come in really handy! more please! :)

Best Regards
Jay
 
Posts: 276
Joined: Tue Jul 13, 2010 5:42 pm

Re: Rectangle & Ellipse Module in Ruby

Postby RJHollins » Thu Aug 22, 2013 6:27 am

Very nice modules and coding chackl !

Thanks for sharing your work. These are items needed for most any project.

Thanks again !!
8-)
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm

Re: Rectangle & Ellipse Module in Ruby

Postby billv » Thu Aug 22, 2013 7:54 am

Very handy at the moment...Thanks for sharing.
Cheers.
billv
 
Posts: 1157
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia

Re: Rectangle & Ellipse Module in Ruby

Postby trogluddite » Thu Aug 22, 2013 11:11 am

Hi chackl - nice stuff, bringing some of the new Ruby graphics options to a simple module. :)

Here's my version of the "options hasher". The @vals data is stored using the saveState/loadState methods, so there's no need for the 'input scanner, so there are far fewer events and triggers kicking about...
Options Hasher.fsm
(1.31 KiB) Downloaded 1372 times


PS) Ruby instance variables (NOT local variables) can always be read, even before they are declared - returning nil if undefined. And there is a shorthand method for testing nils, ".nil?"
So...
Code: Select all
defined?(@vars) == nil

...can be simply written as...
Code: Select all
@vars.nil?


The "||=" that's used in my code is also very handy in situations like this. It's usually known as "OR-equals" - if the variable is undefined, nil or false, it gets assigned the right hand value, otherwise the old value is kept. Just take care if the variable is holding a boolean (true/false) value, though, as 'false' would be overwritten!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Rectangle & Ellipse Module in Ruby

Postby chackl » Thu Aug 22, 2013 12:01 pm

Thanks for the example i'll update it within the next version :D

And thanks for the little ruby lesson :D - I've just began to understand ruby and i'm now experimenting with custom objects and classes.

Thank you :D
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
User avatar
chackl
 
Posts: 233
Joined: Tue Aug 17, 2010 8:46 pm
Location: Austria / Salzburg

Re: Rectangle & Ellipse Module in Ruby

Postby billv » Thu Oct 31, 2013 5:18 am

@chackl..... may have a little bug...
if change fill style to 'solid'
.no color changes possible.... no hatching either... ??..
billv
 
Posts: 1157
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia

Re: Rectangle & Ellipse Module in Ruby

Postby nix » Thu Oct 31, 2013 5:36 am

love the hatching brushes mr. Hackl
is it possible somehow to define the size of the hatches?
User avatar
nix
 
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: Rectangle & Ellipse Module in Ruby

Postby chackl » Tue Nov 05, 2013 1:20 pm

nix wrote:love the hatching brushes mr. Hackl
is it possible somehow to define the size of the hatches?

Thanks ;)
Well i did not find anything - if someone finds a metode i can add it ;)
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
User avatar
chackl
 
Posts: 233
Joined: Tue Aug 17, 2010 8:46 pm
Location: Austria / Salzburg

Re: Rectangle & Ellipse Module in Ruby

Postby chackl » Tue Nov 05, 2013 1:22 pm

billv wrote:@chackl..... may have a little bug...
if change fill style to 'solid'
.no color changes possible.... no hatching either... ??..


Well a hatch allways needs 2 colors ;)
So Hatch is an addition to solid/Linear/Radial.
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
User avatar
chackl
 
Posts: 233
Joined: Tue Aug 17, 2010 8:46 pm
Location: Austria / Salzburg

Next

Return to User Examples

Who is online

Users browsing this forum: No registered users and 71 guests