|
Post by vovchik on Jun 18, 2013 23:26:02 GMT 1
Amazing silver ball bouncing on trampoline
|
|
|
Post by vovchik on Jun 18, 2013 23:26:47 GMT 1
a swinging ball on a chain
|
|
|
Post by vovchik on Jun 18, 2013 23:27:36 GMT 1
a bit of a "tease' cartoon Attachments:
|
|
|
Post by vovchik on Jun 18, 2013 23:28:36 GMT 1
a nicely pulsating water droplet composition (small) Attachments:
|
|
|
Post by vovchik on Jun 18, 2013 23:29:37 GMT 1
water rippling across a mountain lake
|
|
|
Post by vovchik on Jun 18, 2013 23:30:51 GMT 1
a set of concentric circles wobbling mysteriously
|
|
|
Post by alexfish on Jun 19, 2013 3:53:18 GMT 1
Hey Vovchik
Nice set of demo's
Think I will expand the Rippling / "Water Mountains" into a sudo Desktop ;D
Looks Absolutely Fantastic..
BR
Alex
|
|
|
Post by vovchik on Jun 19, 2013 9:37:24 GMT 1
Dear Alex et al.,
Thanks... Here is an internal combustion engine. Looks OK very good in spite of the small numbers of frames and uses less than 2% of my CPU notwithstanding the large images.
With kind regards, vovchik
|
|
|
Post by vovchik on Jun 19, 2013 10:11:50 GMT 1
Dear guys, A nice, spinning question mark that isn't too big. And lots of frames - 40 - at 60 ms and 1% CPU use. Not bad.... With kind regards, vovchik Attachments:
|
|
|
Post by alexfish on Jun 19, 2013 22:26:20 GMT 1
Hi @ All
Here is a useful routine "Scroll_to"
in this demo , Add Goo Canvas , Get the Properties of Canvas / two types -- one for the Root , one for setting the Canvas Properties
May find this useful in gaming , since could have Map or Panoramic View , then if move widgets by Animation as in some of Vovchik's Demos
Then could as they say go for Walkabout , or Runabout , or Race about ....
INCLUDE hug.bac
'@ set HUGOPTIONS , Goo Canvas + No Scaling HUGOPTIONS("CANVAS GOO") HUGOPTIONS("NOSCALING")
'@ for this Example Going to add Scrolling to the Goo Canvas IMPORT "goo_canvas_scroll_to(long,double,double)" FROM HUGLIB$("goo") TYPE void '@ ADD ASSOCIATED ARRAY TO KEEP TRACK OF CAVASES , required if want to use more than one Goo Canvas , DECLARE GOO_CANVAS_PROPERTY_ADDRESS ASSOC NUMBER
'@ for some reason the button-press-event passed user data at forth arg ? / if does not work Please report SUB SCROLL_CANVAS(NUMBER view , NUMBER target , NUMBER event , NUMBER user_data)
PRINT " scroll the canvas : " , view , " : " , target , " : " , event , " : " , user_data '@ scroll the canvas to x-0,y-0 goo_canvas_scroll_to(user_data,0,0)
END SUB
'@ make a Hug Window win = WINDOW("Goo Canvas - Scoll Demo",600,400) '@ make goo canvas and make two rectangles , + get the hug settings canvas_1=CANVAS(600,400) '@ get the root of the Canvas_1 Root_Canvas_1=goo_canvas_get_root_item(hug_widget_image(STR$(canvas_1))) '@ Must catch the hug gui property for cavas_1 this is required to Set The Properties ' this type of reversed logic of hug definitions but more in line with Goo Settings . GOO_CANVAS_PROPERTY_ADDRESS(STR$(Root_Canvas_1))= hug_gui_properties.canvas
'@ test if the Address is working >> here set the bacgound of the canvas to red g_object_set(GOO_CANVAS_PROPERTY_ADDRESS(STR$(Root_Canvas_1)),"background-color","red",NULL)
'@ test to see if can alter the bounds of the canvas to enable Goo Canvas Scrolling , the bound need to be less than x and y or greater the the width ' + height , here going to use both '''' goo_canvas_set_bounds(GOO_CANVAS_PROPERTY_ADDRESS(STR$(Root_Canvas_1)),-100,-100,700,500) ATTACH(win,canvas_1,0,0) '@ draw a square in tradtional hug context , notice where the square is set x = 0 , y = 0 SQUARE("blue",0,0,50,50,1) ' notice there is no return address for the square '@ here make own defined Square Known to Goo as a RECT , on the root canvas , to complete the sequence terminate with NULL '@ Reason for NULL goo rectangle has more properties , my_rectangle_1 = goo_canvas_rect_new(Root_Canvas_1, 50,50,100,50,NULL)
'@ here going to set some properties for the Rectangle.. most are pairs of , end the sequence with NULL.. g_object_set(my_rectangle_1,"fill-color" , "yellow" , "stroke-color" , "grey", "line-width" , (double)2.0,"radius-x",(double)6.0,"radius-y",6.0,NULL)
' @ set a call back to the new rectangle , the call is to SUB SCROLL_CANVAS , the sub will scroll the canvas to x = 0 and y = 0 LOCAL my_canvas TYPE NUMBER my_canvas = GOO_CANVAS_PROPERTY_ADDRESS(STR$(Root_Canvas_1)) PRINT my_canvas g_signal_connect_data(my_rectangle_1, "button-press-event", SCROLL_CANVAS , my_canvas, 0, 0)
DISPLAY
Have Fun
Alex
Edited:: Code..
have been installing new Linux Disto's ... config almost complete
now found the bits for the rect button press /
static gboolean on_rect_button_press (GooCanvasItem *view, GooCanvasItem *target, GdkEventButton *event, gpointer data);
|
|
|
Post by alexfish on Jun 19, 2013 22:42:35 GMT 1
Hi at All and Vovchik We will be making use of NinJa in a later Demo... RE for Usage .. Using librsvg to include adding Opacity , suitable for goo canvas versions without the Alpha channel . opacity = alpha See Attachments BR Alex Attachments:
|
|
|
Post by vovchik on Jun 19, 2013 23:52:53 GMT 1
Dear Alex (et al.), We are getting somewhere. I like your ninja movement demo very much - not yet posted but sit tight people. Work is in progress. Given my weird zeal for producing sprite-like animations, I keep churning them out and have to stop myself from posting everything. Here is one I think is nicer than most... with kind regards, vovchik
|
|
|
Post by vovchik on Jun 20, 2013 0:28:05 GMT 1
Dear all, Here is the same in living colour!. With kind regards, vovchik
|
|
|
Post by vovchik on Jun 20, 2013 0:36:16 GMT 1
And this one is pretty striking, too... Attachments:
|
|
|
Post by vovchik on Jun 20, 2013 12:14:26 GMT 1
Dear guys, How about a bizarrely bouncing cube? With kind regards, vovchik Attachments:
|
|