Sponsored Content
Full Discussion: What do you do for a living?
The Lounge What is on Your Mind? What do you do for a living? Post 302668627 by TH3M0Nk on Monday 9th of July 2012 04:37:27 PM
Old 07-09-2012
People Call us Interface Engineers Healthcare.
I make these interface on AIX.
 

2 More Discussions You Might Find Interesting

1. Linux

Starting over, making a living with linux?

I really like to use linux, although I freely admit I don't know squat about it. I can install it, update it and get it to most of what I would like it to do, up to running some windows apps on it. I am going back so to school starting on the 25th, with a declared major of Information... (1 Reply)
Discussion started by: Methal
1 Replies

2. What is on Your Mind?

Video: What Do You Do for a Living? @UNIX.com

Video: What Do You Do for a Living? @UNIX.com https://youtu.be/eTddtFa_Z_g We asked our users at UNIX.com what they do for a living, and this was their top three replies in 1080 HD video. Shout-outs to quotes in the video from forum members Akshay Hegde, geeky404, ni2 and joeyg. Here... (0 Replies)
Discussion started by: Neo
0 Replies
pods::SDLx::Controller::Interface(3pm)			User Contributed Perl Documentation		    pods::SDLx::Controller::Interface(3pm)

NAME
SDLx::Controller::Interface - Interface Physics and Rendering with the Controller with callbacks CATEGORY
Extension, Controller SYNOPSIS
use SDL; use SDLx::App; use SDLx::Controller::Interface; #SDLx::App is a controller my $app = SDLx::App->new(width => 200, height => 200 ); my $ball = SDLx::Controller::Interface->new( x=> 10, y => 50, v_x => 10, v_y=> 20 ); #Set the initial state of the ball's physics, this is optional $ball->set_acceleration( sub { my ($time, $current_state) = @_; return( 0, -10, 0 ); # Return accelerations (x,y,rotation) } ); my $ball_render = sub { my $state = shift; $app->draw_rect( undef, 0 ); $app->draw_rect( [$state->x, $state->y, 10,10], [255,0,0,255] ); $app->update(); }; $ball->attach( $app, $ball_render, @params ); $app->run(); $ball->detach(); #can be called at anytime (for example when ball 'dies') DESCRIPTION
METHODS
set_acceleration Allows you to set the acceleration callback for defining the interface's behaviour in terms of x,y and rotation. $interface->set_acceleration ( sub { my ($time, $current_state) = @_; return ( $accel_x, $accel_y, $torque ); } ); These accelerations are arbitrary and can be set to any frame of reference. Your render callback will handle how to interpret it. The callback will receive the time and the current state as a "SDLx::Controller::State" element. attach Attaches the interface to a controller with a render callback $interface->attach( $controller, $render, @params ); Where $render is a callback that receives the interpolated "SDLx::Controller::State". my $render = sub { my ($state, @params) = @_; # draw the current $state. }; The @params are any extra parameters you would like to pass to the $render callback. current my $current_state = $interface->current(); Returns the current state of the interface as a "SDLx::Controller::State". previous my $previous_state = $interface->previous(); Returns the previous state of the interface as a "SDLx::Controller::State". detach $interface->detach(); If $interface has been "attach()"'ed to any controller it will be detached now. OTHER METHODS
Don't use these unless you really really want to. acceleration Call the acceleration callback once. interpolate Interpolate the current state evaluate Evaluate the new current and previous state. update Update the states by integrating with time. AUTHORS
See "AUTHORS" in SDL. perl v5.14.2 2012-05-28 pods::SDLx::Controller::Interface(3pm)
All times are GMT -4. The time now is 07:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy