Search Results

Search found 774 results on 31 pages for 'animations'.

Page 5/31 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Different animations for Jquery ui tabs

    - by audiopleb
    I'm using jquery ui tabs widget. I've not used a jquery theme as i prefer to do my own css and stuff. I've got it working, but what i'd like is to have a different animation effect for the tab content when a different tab is clicked. What i'd like is for the new tab content to slide in from the left. At the moment i have: $("#tabs").tabs({ fx: {slide: 'slow' } }); }); I know the code above is just slide and not slide left but it doesn't even do a slide! I have downloaded the slide effects as part of my custom ui download. I don't know why it isn't working! Is it some css that i'm lacking?! I don't know!!!

    Read the article

  • Java or C# + XNA for some simple animations?

    - by lala
    I want to make a program that will involve some faces with various facial expressions. They will change from one facial expression to another based on their "mood" as influenced by user input. I know some java but I have done pretty much nothing with graphics. A friend tells me that it will be easier to do this in C# with XNA than to do it in java. I have about a month to do this, so I was hoping you folks would help me make a decision. Would I be better off figuring out how to do this in java, or learning C# and XNA and doing it in C#? Is it so much easier to do this in C# that it would be quicker to learn C# than to struggle with doing it in java? Will it probably come out looking much better if it is in C#?

    Read the article

  • Chaining Animations (iPhone / MonoTouch)

    - by ifwdev
    I'm trying to slide some (custom) tab-like buttons into view. I don't want them all to move at the same time. Also, they shouldn't move one at at time (where one slides after the other finishes). I want each button to begin sliding slightly after the previous. Preferably it would happen on a curve but just a fixed .1 second offset would be alright too. Monotouch or Obj-C code is fine. I'm thinking there is something in the APIs for animating groups of items like this. Hopefully, at least...

    Read the article

  • alot questings since i wanted to make a new SSB game or mario game(that use 3d models) [closed]

    - by user20465
    i have just started to study programming and i know already ppl will say why make a so big project like as a SSB game for a noob game development? cuz i always wanted a SSB engine like as Mugen is a fighter game engine but is not like as SSB´s gameplay + is not using 3d models too so i will call it SSBmugen(until i find a better title for it i got afew ideas for titles) also i wanted to make this game so it can use SSBbrawl files(models+animations mainly) the moveset+Stage coding files i wanted to redo cuz so anything can be possible like make a teleporter or a pipe teleporter(like as Super mario bros game) on a stag e or make some stuff there is impossible in SSBbrawl for moveset coding but is not in SSBmugen like make so a char. summon a Clone and the clone will do a attack and then is gone or some attacks/moves also i will make a moveset/stage Coding editor so it will be really easy to make moveset/stages coding for yours 3d models/animations moveset+stage Coding i mean: hitboxes/hurtboxes/moving Stuff/moving bones like cape or hair bones that is moving by wind effects or falling or other stuff like that/other stuff that needed to be coded i have planed to make a editor(for moveset/char. coding) or add the editor in brawlbox for my game so other ppl can easy make moveset/stages Coding to they´s models/animations so it will be easy so even kids can make a custom movesets/stages why using SSBbrawl files?: cuz ppl have made alot of models or textures/custom movesets/custom stages like goku/other anime/not brawl stuff for super smash bros brawl hacking(a.k.a modding) so ppl dont have to redo anything if they wanted to have the custom models or textures/custom movesets/custom stages from SSBbrawl to SSBmugen +there is the program named brawlbox that can open brawl files like model/animations and can edit models or animations and import models from 3ds max to be the right model format for SSBbrawl and i also wanted it so easy to add(a.k.a installer) Recolours or alt. models(like as oneslot doctor mario model over mario´s boneset) or textures/Movesets/new char. slots/new stages so easy so you only needing to download themplace them in right foldername them the right nameStart the gameRecolours or alt. models or textures/Movesets/new char. slots/new stages works an loading right so you wont needing to edit any files for add something so kids/not so smart ppl can easy use the mods other ppl is making/uploading for this game here is the file format i wanted to know if they can be readed/opened if making a game that use these files: .mld0(brawl model file) .chr0(model animation for moving/scale/rota the bones) .srt0(animations for texture like moving eyes or blinking) .vis0(Animations for get polygons to hide/show with visibilitybones on the model there is also some polygons there ) .brres(a file format where stuff like model files or textures or animations is inside) .pac(a file format where the .brres is inside to keep model+textures+model for the shadow in 1 file) .wav (for SoundFX effects or voices to char. or stages) i am sure that one is possible the .wav files is inside a other file format for brawl but that file can´t you add more .wav files inside only replace so i wanted the .wav files outside so its easy to add/replace/remove SoundFX effects or voices to char. or stages .brstm(brawl music file so the music is looped perfect so it loop in middel of the music and not start over again then the music is done) afew more file formats (mainly for the Graphics effects like fire/aura/hit effects if not needing to redo them)so only coding in the editor i will make is needed to be done for port a SSBB hack(a.k.a mod)(moveset/stage coding) to this game wanted the game to be able to load these files and load them right like if loading wait1.chr0(idle animation) it will also load at same time wait1.srt0/wait1.vis0 and all kinda of animations is inside the same .brres file i am needing since it to be able to load the file format i wanted cuz: -the animations can´t be converted to any other animation file format and i dont think ppl want to redo these animations(inc. me for Goku to SSBbrawl) -models can be converted but then they lose all the shader/materials stuff like a shine effect or lighting on the model -.brstm can be converted to .wav but then there will be no loop so i prefer it can load this file format too for the music to stage/menu -brawlbox is really easy to use for make animation for the char. and import models from 3ds max so even around "not too stupid" 10 year kids can make SSBB mods(not try to be rude but to say how easy it is) also i wanted the folder setup for characters/stages/moveset/other stuff to be like this: https://www.dropbox.com/s/2oolm5z5ri234tz/SSBmugen%20Folder%20setup.txt just uploaded a txt file since it is a wall of text and this post is already a wall of test so it easy to place stuff (if not i do a program for to that so it auto place the stuff on right place) not 100% sure what to use of game engine to make this possible but i got a dll file from that brawlbox program that can open/read/edit these file formats if that helps i also got open source of brawlbox i have kinda learned programming(since its kinda the same thing but still not 100% same) from Super smash bros modding/hacking like coding a moveset for the new animations/models + have readed alittle about it but i am soon starting for real to study it for ppl who is alittle confuse for what i am asking for here is the list: -what game engine should i use to make a SSB clone? but at same time to make all this stuff i just said possible so ppl can make they own mods and share them and use the already made mods from SSBbrawl? and easy to use aswell so noob programmors can use it? -where to learning programming on internet to be even more ready to make a game like this? and dont wanted to start in the small like making small boring 2d games that no one care about anyway ps. i am also planing a other project like as SSBmugen but it will be Super mario bros open (again tittle unsure but open means open source) i will make a Mario game engine that also use 3d models and can have 2d or 3d gameplay with any mario powerups/gameplay(from any mario platform games) there is ever made multiplayer like as in New super mario bros wii maybe multiplay over lan or online but for now over 1 PC also alittle planed for that to my SSBmugen a Level/world map editor for it too(easy to use so even kids can use it and make levels for it) so it just place the objects/enemies and options for them enemies since they are not 100% same AI in all mario game like to choose a goomba have AI from SM64 the Editor will be able to change the gameplay on a level while have a other gameplay on a other level like this: 1 level have Super mario bros 3 gameplay (then it will be a 3d model remake) a other level have super mario galaxy gameplay but in a Super mario 3d land level yet a other level have super mario 64 gameplay but with powerups from a other mario game like powerups from mario 3d land or can ride on Yoshi so you can easy remake your fav. level from a old mario game in this mario engine/editor or just make a custom one with yours fav. mario gameplay/powerups so it will be like turn off/on: walljump/triple jump/other kinda or jumps/2x punch and 1 kick+Air kick/SMG spin attack/Fludd/other stuff like that so you can make the gameplay from the first mario game to the newest or make custom gameplay on a level also the star(from 64/sunshine/galaxy) will be replaced with the flag from new super mario bros/mario 3d land since the game is not so much about getting stars its more about making/download the levels you wanted and share them to other ppl and play these level so after have killed like the boss from SM64 bomb omb field(if one have made that) you will get the flag instead of star since i wanted it to be simple to make levels in the editor to make the bosses/new enemies/new powerups/custom char. idk what to do to make that simple yet also thinking the mario game will use brawl files since it almost already got all needed animations/models for this since i dont wanted to redo animations/models and if needing more animations i can just make them easy in brawlbox since thats the program i am most used to make animations but that will be after my SSBmugen project if not this game will be easyer then SSBmugen to make since i am planing then 1 of them is done i use the that game as base to make the other (since both is kinda platfrom games and possible using same file format for both) also wanted to ask what is best to start with out of these 2 games? also will maybe make a DLC site(or ingame) for both of these games if they get done so it wont end up like as Mugen where you needing to look all over the internet to find the stuff you wanted but for my game all the mods for my game is on same place not sure about online mode for SSBmugen or super mario bros open but i can always add that then i get better at programming both games also need to have options on controls/if using joystick also that i have planed these game for a long time and got even more ideas for them but first i wanted to get them to work so i can add the other stuff later(like DLC or online mode or some other stuff later) right now i know 0,0001% to programming(in my option) maybe i know more then that since i have been study it alittle but i learning while making stuff like this that was also my plan for make these game learn while making them and get better to programming so again i say it i kinda dont want to hear dont do these projects cuz i already know it will be hard so dont wanted so much to heard stuff like: you can´t do it since you just started learning programming or this project will fail since somewhere i needing to get started with programming and this is where i want to start to make my dream games(possible other´s dream games too) and i dont think this project will fail if i work hard on it (as i possible will) and ppl will maybe help i think this was all my questing/ideas for now (sorry for it sounds more like ideas then questings) but i needing to say my ideas so you ppl can see what i needing to use for make this possible

    Read the article

  • How to go to the next level integrating animations in WPF applications with Blend / VS2008?

    - by Edward Tanguay
    I have been able to create little animations with the storyline in Blend. And I have been able to copy in the isolated storylines and triggers into existing projects in visual studio to spruce them up on the edges a little bit. But after adding too many animations, they start to conflict or cancel each other out, etc., or I can make a panel slide down and slide it back up, then it no longer can slide down since it is not in its original state anymore. Does anyone have any links, video tutorials, books, resources which not only show you how to make a little animation and then leave you to figure out how to integrate numerous animations into a typical business application layout, but instead take you through the whole process of building a business application while integrating animations and WPF goodness with Blend and Visual Studio?

    Read the article

  • Animate opacity and delay transition CSS

    - by user1876246
    I have a series of DIVS, I want DIV 1 & DIV 3 to fade out and then DIV 2 and DIV 4 to slide left to take their place, 1 second after the fade. So far I have gotten them to fade out but I cannot figure out how to delay the sliding. Follows is my CSS, ignore the lack of vendor prefixes for this question please. .slide-show{ -webkit-animation: fadeShow 0.25s 1 normal forwards ease-out; animation: fadeShow 0.25s 1 normal forwards ease-out; visibility: visible; } .slide-hide{ -webkit-animation: fadeHide 0.25s 1 normal forwards ease-out; animation: fadeHide 0.25s 1 normal forwards ease-out; //I need the following to be delayed for 1 second visibility: hidden; position: absolute; } @keyframes fadeHide{ 0% { opacity: 1; } 100% { opacity: 0; } } @keyframes fadeShow{ 0% { opacity: 0; } 100% { opacity: 1; } }

    Read the article

  • Where can I find a jQuery color animation plugin?

    - by George Edison
    I need an up-to-date jQuery color animation plugin that works in IE 8. I tried using the one at http://plugins.jquery.com/project/color but it causes errors like "Invalid property value." in the following line of code from color.js: fx.elem.style[attr] = "rgb(" + [ Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0), Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0), Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0) ].join(",") + ")"; Where can I get something that works? By the way, I really hate IE, if that helps.

    Read the article

  • Generate xml containing animation information from ms ppt 2003/07 file

    - by Ravisha
    I am planning to write an application which has UI from MS ppt.Here is where all the animation will be configured. My application will just read xmls containing animation configuration and run it on a target device(Cannot mention details w.r.t device right now ,apologies for that) Not necessary that i want xmls it self but if there is a way to get animation details directly from the ppt file i will be more than happy. I will be going ahead with C#.Net 3.0 with windows XP as my OS.MY office will be either 2003 or 07.Can switch to any of these versions Please give suggestions as what will be the starting point for the same.Thanks in advance Please Let me know if any more details are needed

    Read the article

  • AnimationDrawable, when does it end?

    - by Syb
    I know there have been several people with the same question. Which is: How do i know when a frame by frame animation has ended? I have not had any useful answer on fora i visited. So i thought, let's see if they know at stackoverflow. But I could not sit still in the mean time, so i made a work around of this, but it does not really work the way i would like it to. here is the code: public class Main extends Activity { AnimationDrawable sybAnimation; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ImageView imageView = (ImageView)findViewById(R.id.ImageView01); imageView.setBackgroundResource(R.anim.testanimation); sybAnimation = (AnimationDrawable) imageView.getBackground(); imageView.post(new Starter()); } class Starter implements Runnable { public void run() { sybAnimation.start(); long totalDuration = 0; for(int i = 0; i< sybAnimation.getNumberOfFrames();i++){ totalDuration += sybAnimation.getDuration(i); } Timer timer = new Timer(); timer.schedule(new AnimationFollowUpTimerTask(R.id.ImageView01, R.anim.testanimation_reverse),totalDuration); } } class AnimationFollowUpTimerTask extends TimerTask { private int id; private int animationToRunId; public AnimationFollowUpTimerTask(int idOfImageView, int animationXML){ id = idOfImageView; animationToRunId = animationXML; } @Override public void run() { ImageView imageView = (ImageView)findViewById(id); imageView.setBackgroundResource(animationToRunId); AnimationDrawable anim = (AnimationDrawable) imageView.getBackground(); anim.start(); } } basically I make a timertask which is scheduled with the same time as the animation to take. In that run() I want to load a new animation into the imageView and start that animation, this however does not work. Does anyone know how to get this to work, or even better, have a better way to find out when an AnimationDrawable has ended its animation?

    Read the article

  • ThicknessAnimationUsingKeyFrames doesn't work the first time, but second and all subsequent times wo

    - by 110022530536665626169
    I have the following Storyboard: 'LayoutMargin' is a dependency property defined in the ancestor Window. This is the problem I'm having: The first time I run the animation it doesn't work - as if the LayoutMargin.Value isn't set. However, the second time I run the animation, and all subsequent times I run the animation, it work just fine. At first I suspected the LayoutMargin.Value was not set prior to the first animation, but it is set. Does anyone have any ideas about why this is happening?

    Read the article

  • How can I efficiently create/store/implement animations as I add to my game?

    - by nickbadal
    My game's characters are made up of different parts (head/body/legs/etc), and whatever items they have equipped. As I'm creating the animation system for my game, I want to try to anticipate a large number of combinations for different pieces for each character. Originally, I had planned on having a frame-by frame animation for each piece for each animation, and then layer them to combine them into a character, but this seems like it would be a lot of work for my artist, and that the memory/disk size would start to add up as well since we would need a sprite for every frame, of every customization of every piece, in every animation, for every character. What efficient ways are there to create/implement these animations as we add more and more configurations to our game?

    Read the article

  • iPhone Open GL ES using FBX - How do I import animations from FBX into iPhone?

    - by Dominic Tancredi
    I've been researching this extensively. We have a game that's 90% complete, using custom game logic in iPhone 4.0. We've been asked to import a 3D model and have it animate when various events happen in the game. I've put together an OpenGL view (based on Eagl and several examples), and used Blender to import the model, as well as Jeff LeMarche's script to export the .h file. After much trial, it worked, and I was able to show a rotating model (unskinned). However, the 3d artist hadn't UV unwrapped the model, so provided me a new model, this one as a Maya file, along with animation in a FBX format, a .obj file, and .tga texture unwrapped. My question is : how can I use FBX inside OpenGL ES inside iPhone to run through animations? And what's the pipeline to get this Maya file into Blender to be able to create a .h file. I've tried the obj2opengl however the model is missing normals (did it have it in the first place?) and the skin isn't applying at all (possibly a code issue, something I think I can fix). I'm trying to use Jeff LeMarche's animation tutorial but can't figure out how to get the model files into a proper .h file for use. Any advice?

    Read the article

  • What are some ways to separate game logic from animations and the draw loop?

    - by TMV
    I have only previously made flash games, using MovieClips and such to separate out my animations from my game logic. Now I am getting into trying my hand at making a game for Android, but the game programming theory around separating these things still confuses me. I come from a background of developing non game web applications so I am versed in more MVC like patterns and am stuck in that mindset as I approach game programming. I want to do things like abstract my game by having, for example, a game board class that contains the data for a grid of tiles with instances of a tile class that each contain properties. I can give my draw loop access to this and have it draw the game board based on the properties of each tile on the game board, but I don't understand where exactly animation should go. As far as I can tell, animation sort of sits between the abstracted game logic (model) and the draw loop (view). With my MVC mindset, it's frustrating trying to decide where animation is actually supposed to go. It would have quite a bit of data associated with it like a model, but seemingly needs to be very closely coupled with the draw loop in order to have things like frame independent animation. How can I break out of this mindset and start thinking about patterns that make more sense for games?

    Read the article

  • How can I get pidgin to replace animations/graphics with their alt text?

    - by Flimzy
    I have a few contacts who use annoying text-to-animation plugins in their clients, that do things like turn the word "hi" into an animation of Kermit the Frog waving at me, or other equally annoying non-sense. This is even more annoying when it does the conversion mid-word, like turning "This" into "T<Kermit waving>s". To get around this annoying behavior, I often find myself copying their text from pidgin, and pasting into a text editor, which always replaces the animations with their original text (presumably by way of some html ALT tag, or the moral equivalent). Obviously pidgin knows what the original text was, because it was able to provide that text to the copy buffer. So how can I get Pidgin to just show me the original text, as if there were no annoying animations in the first place?

    Read the article

  • Think before you animate

    - by David Paquette
    Animations are becoming more and more common in our applications.  With technologies like WPF, Silverlight and jQuery, animations are becoming easier for developers to use (and abuse).  When used properly, animation can augment the user experience.  When used improperly, animation can degrade the user experience.  Sometimes, the differences can be very subtle. I have recently made use of animations in a few projects and I very quickly realized how easy it is to abuse animation techniques.  Here are a few things I have learned along the way. 1) Don’t animate for the sake of animating We’ve all seen the PowerPoint slides with annoying slide transitions that animate 20 different ways.  It’s distracting and tacky.  The same holds true for your application.  While animations are fun and becoming easy to implement, resist the urge to use the technology just because you think the technology is amazing.   2) Animations should (and do) have meaning I recently built a simple Windows Phone 7 (WP7) application, Steeped (download it here).  The application has 2 pages.  The first page lists a number of tea types.  When the user taps on one of the tea types, the application navigates to the second page with information about that tea type and some options for the user to choose from.       One of the last things I did before submitting Steeped to the marketplace was add a page transition between the 2 pages.  I choose the Slide / Fade Out transition.  When the user selects a tea type, the main page slides to the left and fades out.  At the same time, the details page slides in from the right and fades in.  I tested it and thought it looked great so I submitted the app.  A few days later, I asked a friend to try the app.  He selected a tea type, and I was a little surprised by how he used the app.  When he wanted to navigate back to the main page, instead of pressing the back button on the phone, he tried to use a swiping gesture.  Of course, the swiping gesture did nothing because I had not implemented that feature.  After thinking about it for a while, I realized that the page transition I had chosen implied a particular behaviour.  As a user, if an action I perform causes an item (in this case the page) to move, then my expectation is that I should be able to move it back.  I have since added logic to handle the swipe gesture and I think the app flows much better now. When using animation, it pays to ask yourself:  What story does this animation tell my users?   3) Watch the replay Some animations might seem great initially but can get annoying over time.  When you use an animation in your application, make sure you try using it over and over again to make sure it doesn’t get annoying.  When I add an animation, I try watch it at least 25 times in a row.  After watching the animation repeatedly, I can make a more informed decision whether or not I should keep the animation.  Often, I end up shortening the length of the animations.   4) Don’t get in the users way An animation should never slow the user down.  When implemented properly, an animation can give a perceived bump in performance.  A good example of this is a the page transitions in most of the built in apps on WP7.  Obviously, these page animations don’t make the phone any faster, but they do provide a more responsive user experience.  Why?  Because most of the animations begin as soon as the user has performed some action.  The destination page might not be fully loaded yet, but the system responded immediately to user action, giving the impression that the system is more responsive.  If the user did not see anything happen until after the destination page was fully loaded, the application would feel clumsy and slow.  Also, it is important to make sure the animation does not degrade the performance (or perceived performance) of the application.   Jut a few things to consider when using animations.  As is the case with many technologies, we often learn how to misuse it before we learn how to use it effectively.

    Read the article

  • What animation technique is used in 'Dont Starve'?

    - by Bugster
    While playing a few games in my personal time off development I've stumbled across a survival 2D/3D survival game. The game was apparently made in SDL and GLUT (Dont starve) but what really amazed me was the animations in the game. The animations are extremely smooth and fluent. There is no distortion while animating, what usually happens in hand-made animations is that pixels get removed, animations are jaggy and they simply aren't as smooth. That got me thinking on how they managed to accomplish such a quality of animations. Were they really handmade (If they were, then it must've taken a very talented artist), is it bone animation or are they using another technique?

    Read the article

  • How do I disable animations in Preview in Lion?

    - by c00kiemonster
    For example, open up a pdf and set view to two pages and hit arrow key up/down. Is there a way to get rid of the animation? Preview feels really snappy and fast, and to have animations like that just spoils all the fun. Might seem like a proper first world problem, especially if you're just a casual user of pdfs. But I frequently have 10+ pdfs open for referencing purposes (that is, a lot of flicking back and fourth), and the animation just drives me nuts.

    Read the article

  • How do I export physique animations without breaking them?

    - by Paul Ferris
    I've been trying to export a simple footstep animation that I made in 3ds Max, but its either failed to export or broken (imported into unity sans a few frames, or appearing to have imported but not playing) every single time. I've tried .fbx and .3ds, but neither works. I'd rather not use the Skin modifier, because it would require starting from scratch and learning a new system. Any ideas? EDIT: I found a workaround, here it is if you're curious: Create your biped, and make sure it lines up with your mesh. Animate it Export the mesh without Physique (or with Physique turned off), then delete it (the mesh) Export the biped Recombine in Unity (or whatever your game engine of choice is)

    Read the article

  • iPhone SDK vs. Windows Phone 7 Series SDK Challenge, Part 2: MoveMe

    In this series, I will be taking sample applications from the iPhone SDK and implementing them on Windows Phone 7 Series.  My goal is to do as much of an apples-to-apples comparison as I can.  This series will be written to not only compare and contrast how easy or difficult it is to complete tasks on either platform, how many lines of code, etc., but Id also like it to be a way for iPhone developers to either get started on Windows Phone 7 Series development, or for developers in general to learn the platform. Heres my methodology: Run the iPhone SDK app in the iPhone Simulator to get a feel for what it does and how it works, without looking at the implementation Implement the equivalent functionality on Windows Phone 7 Series using Silverlight. Compare the two implementations based on complexity, functionality, lines of code, number of files, etc. Add some functionality to the Windows Phone 7 Series app that shows off a way to make the scenario more interesting or leverages an aspect of the platform, or uses a better design pattern to implement the functionality. You can download Microsoft Visual Studio 2010 Express for Windows Phone CTP here, and the Expression Blend 4 Beta here. If youre seeing this series for the first time, check out Part 1: Hello World. A note on methodologyin the prior post there was some feedback about lines of code not being a very good metric for this exercise.  I dont really disagree, theres a lot more to this than lines of code but I believe that is a relevant metric, even if its not the ultimate one.  And theres no perfect answer here.  So I am going to continue to report the number of lines of code that I, as a developer would need to write in these apps as a data point, and Ill leave it up to the reader to determine how that fits in with overall complexity, etc.  The first example was so basic that I think it was difficult to talk about in real terms.  I think that as these apps get more complex, the subjective differences in concept count and will be more important.  MoveMe The MoveMe app is the main end-to-end app writing example in the iPhone SDK, called Creating an iPhone Application.  This application demonstrates a few concepts, including handling touch input, how to do animations, and how to do some basic transforms. The behavior of the application is pretty simple.  User touches the button: The button does a throb type animation where it scales up and then back down briefly. User drags the button: After a touch begins, moving the touch point will drag the button around with the touch. User lets go of the button: The button animates back to its original position, but does a few small bounces as it reaches its original point, which makes the app fun and gives it an extra bit of interactivity. Now, how would I write an app that meets this spec for Windows Phone 7 Series, and how hard would it be?  Lets find out!     Implementing the UI Okay, lets build the UI for this application.  In the HelloWorld example, we did all the UI design in Visual Studio and/or by hand in XAML.  In this example, were going to use the Expression Blend 4 Beta. You might be wondering when to use Visual Studio, when to use Blend, and when to do XAML by hand.  Different people will have different takes on this, but heres mine: XAML by hand simple UI that doesnt contain animations, gradients, etc., and or UI that I want to really optimize and craft when I know exactly what I want to do. Visual Studio Basic UI layout, property setting, data binding, etc. Blend Any serious design work needs to be done in Blend, including animations, handling states and transitions, styling and templating, editing resources. As in Part 1, go ahead and fire up Visual Studio 2010 Express for Windows Phone (yes, soon it will take longer to say the name of our products than to start them up!), and create a new Windows Phone Application.  As in Part 1, clear out the XAML from the designer.  An easy way to do this is to just: Click on the design surface Hit Control+A Hit Delete Theres a little bit left over (the Grid.RowDefinitions element), just go ahead and delete that element so were starting with a clean state of only one outer Grid element. To use Blend, we need to save this project.  See, when you create a project with Visual Studio Express, it doesnt commit it to the disk (well, in a place where you can find it, at least) until you actually save the project.  This is handy if youre doing some fooling around, because it doesnt clutter your disk with WindowsPhoneApplication23-like directories.  But its also kind of dangerous, since when you close VS, if you dont save the projectits all gone.  Yes, this has bitten me since I was saving files and didnt remember that, so be careful to save the project/solution via Save All, at least once. So, save and note the location on disk.  Start Expression Blend 4 Beta, and chose File > Open Project/Solution, and load your project.  You should see just about the same thing you saw over in VS: a blank, black designer surface. Now, thinking about this application, we dont really need a button, even though it looks like one.  We never click it.  So were just going to create a visual and use that.  This is also true in the iPhone example above, where the visual is actually not a button either but a jpg image with a nice gradient and round edges.  Well do something simple here that looks pretty good. In Blend, look in the tool pane on the left for the icon that looks like the below (the highlighted one on the left), and hold it down to get the popout menu, and choose Border:    Okay, now draw out a box in the middle of the design surface of about 300x100.  The Properties Pane to the left should show the properties for this item. First, lets make it more visible by giving it a border brush.  Set the BorderBrush to white by clicking BorderBrush and dragging the color selector all the way to the upper right in the palette.  Then, down a bit farther, make the BorderThickness 4 all the way around, and the CornerRadius set to 6. In the Layout section, do the following to Width, Height, Horizontal and Vertical Alignment, and Margin (all 4 margin values): Youll see the outline now is in the middle of the design surface.  Now lets give it a background color.  Above BorderBrush select Background, and click the third tab over: Gradient Brush.  Youll see a gradient slider at the bottom, and if you click the markers, you can edit the gradient stops individually (or add more).  In this case, you can select something you like, but wheres what I chose: Left stop: #BFACCFE2 (I just picked a spot on the palette and set opacity to 75%, no magic here, feel free to fiddle these or just enter these numbers into the hex area and be done with it) Right stop: #FF3E738F Okay, looks pretty good.  Finally set the name of the element in the Name field at the top of the Properties pane to welcome. Now lets add some text.  Just hit T and itll select the TextBlock tool automatically: Now draw out some are inside our welcome visual and type Welcome!, then click on the design surface (to exit text entry mode) and hit V to go back into selection mode (or the top item in the tool pane that looks like a mouse pointer).  Click on the text again to select it in the tool pane.  Just like the border, we want to center this.  So set HorizontalAlignment and VerticalAlignment to Center, and clear the Margins: Thats it for the UI.  Heres how it looks, on the design surface: Not bad!  Okay, now the fun part Adding Animations Using Blend to build animations is a lot of fun, and its easy.  In XAML, I can not only declare elements and visuals, but also I can declare animations that will affect those visuals.  These are called Storyboards. To recap, well be doing two animations: The throb animation when the element is touched The center animation when the element is released after being dragged. The throb animation is just a scale transform, so well do that first.  In the Objects and Timeline Pane (left side, bottom half), click the little + icon to add a new Storyboard called touchStoryboard: The timeline view will appear.  In there, click a bit to the right of 0 to create a keyframe at .2 seconds: Now, click on our welcome element (the Border, not the TextBlock in it), and scroll to the bottom of the Properties Pane.  Open up Transform, click the third tab ("Scale), and set X and Y to 1.2: This all of this says that, at .2 seconds, I want the X and Y size of this element to scale to 1.2. In fact you can see this happen.  Push the Play arrow in the timeline view, and youll see the animation run! Lets make two tweaks.  First, we want the animation to automatically reverse so it scales up then back down nicely. Click in the dropdown that says touchStoryboard in Objects and Timeline, then in the Properties pane check Auto Reverse: Now run it again, and youll see it go both ways. Lets even make it nicer by adding an easing function. First, click on the Render Transform item in the Objects tree, then, in the Property Pane, youll see a bunch of easing functions to choose from.  Feel free to play with this, then seeing how each runs.  I chose Circle In, but some other ones are fun.  Try them out!  Elastic In is kind of fun, but well stick with Circle In.  Thats it for that animation. Now, we also want an animation to move the Border back to its original position when the user ends the touch gesture.  This is exactly the same process as above, but just targeting a different transform property. Create a new animation called releaseStoryboard Select a timeline point at 1.2 seconds. Click on the welcome Border element again Scroll to the Transforms panel at the bottom of the Properties Pane Choose the first tab (Translate), which may already be selected Set both X and Y values to 0.0 (we do this just to make the values stick, because the value is already 0 and we need Blend to know we want to save that value) Click on RenderTransform in the Objects tree In the properties pane, choose Bounce Out Set Bounces to 6, and Bounciness to 4 (feel free to play with these as well) Okay, were done. Note, if you want to test this Storyboard, you have to do something a little tricky because the final value is the same as the initial value, so playing it does nothing.  If you want to play with it, do the following: Next to the selection dropdown, hit the little "x (Close Storyboard) Go to the Translate Transform value for welcome Set X,Y to 50, 200, respectively (or whatever) Select releaseStoryboard again from the dropdown Hit play, see it run Go into the object tree and select RenderTransform to change the easing function. When youre done, hit the Close Storyboard x again and set the values in Transform/Translate back to 0 Wiring Up the Animations Okay, now go back to Visual Studio.  Youll get a prompt due to the modification of MainPage.xaml.  Hit Yes. In the designer, click on the welcome Border element.  In the Property Browser, hit the Events button, then double click each of ManipulationStarted, ManipulationDelta, ManipulationCompleted.  Youll need to flip back to the designer from code, after each double click. Its code time.  Here we go. Here, three event handlers have been created for us: welcome_ManipulationStarted: This will execute when a manipulation begins.  Think of it as MouseDown. welcome_ManipulationDelta: This executes each time a manipulation changes.  Think MouseMove. welcome_ManipulationCompleted: This will  execute when the manipulation ends. Think MouseUp. Now, in ManipuliationStarted, we want to kick off the throb animation that we called touchAnimation.  Thats easy: 1: private void welcome_ManipulationStarted(object sender, ManipulationStartedEventArgs e) 2: { 3: touchStoryboard.Begin(); 4: } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Likewise, when the manipulation completes, we want to re-center the welcome visual with our bounce animation: 1: private void welcome_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) 2: { 3: releaseStoryboard.Begin(); 4: } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Note there is actually a way to kick off these animations from Blend directly via something called Triggers, but I think its clearer to show whats going on like this.  A Trigger basically allows you to say When this event fires, trigger this Storyboard, so its the exact same logical process as above, but without the code. But how do we get the object to move?  Well, for that we really dont want an animation because we want it to respond immediately to user input. We do this by directly modifying the transform to match the offset for the manipulation, and then well let the animation bring it back to zero when the manipulation completes.  The manipulation events do a great job of keeping track of all the stuff that you usually had to do yourself when doing drags: where you started from, how far youve moved, etc. So we can easily modify the position as below: 1: private void welcome_ManipulationDelta(object sender, ManipulationDeltaEventArgs e) 2: { 3: CompositeTransform transform = (CompositeTransform)welcome.RenderTransform; 4:   5: transform.TranslateX = e.CumulativeManipulation.Translation.X; 6: transform.TranslateY = e.CumulativeManipulation.Translation.Y; 7: } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Thats it! Go ahead and run the app in the emulator.  I suggest running without the debugger, its a little faster (CTRL+F5).  If youve got a machine that supports DirectX 10, youll see nice smooth GPU accelerated graphics, which also what it looks like on the phone, running at about 60 frames per second.  If your machine does not support DX10 (like the laptop Im writing this on!), it wont be quite a smooth so youll have to take my word for it! Comparing Against the iPhone This is an example where the flexibility and power of XAML meets the tooling of Visual Studio and Blend, and the whole experience really shines.  So, for several things that are declarative and 100% toolable with the Windows Phone 7 Series, this example does them with code on the iPhone.  In parens is the lines of code that I count to do these operations. PlacardView.m: 19 total LOC Creating the view that hosts the button-like image and the text Drawing the image that is the background of the button Drawing the Welcome text over the image (I think you could technically do this step and/or the prior one using Interface Builder) MoveMeView.m:  63 total LOC Constructing and running the scale (throb) animation (25) Constructing the path describing the animation back to center plus bounce effect (38) Beyond the code count, yy experience with doing this kind of thing in code is that its VERY time intensive.  When I was a developer back on Windows Forms, doing GDI+ drawing, we did this stuff a lot, and it took forever!  You write some code and even once you get it basically working, you see its not quite right, you go back, tweak the interval, or the math a bit, run it again, etc.  You can take a look at the iPhone code here to judge for yourself.  Scroll down to animatePlacardViewToCenter toward the bottom.  I dont think this code is terribly complicated, but its not what Id call simple and its not at all simple to get right. And then theres a few other lines of code running around for setting up the ViewController and the Views, about 15 lines between MoveMeAppDelegate, PlacardView, and MoveMeView, plus the assorted decls in the h files. Adding those up, I conservatively get something like 100 lines of code (19+63+15+decls) on iPhone that I have to write, by hand, to make this project work. The lines of code that I wrote in the examples above is 5 lines of code on Windows Phone 7 Series. In terms of incremental concept counts beyond the HelloWorld app, heres a shot at that: iPhone: Drawing Images Drawing Text Handling touch events Creating animations Scaling animations Building a path and animating along that Windows Phone 7 Series: Laying out UI in Blend Creating & testing basic animations in Blend Handling touch events Invoking animations from code This was actually the first example I tried converting, even before I did the HelloWorld, and I was pretty surprised.  Some of this is luck that this app happens to match up with the Windows Phone 7 Series platform just perfectly.  In terms of time, I wrote the above application, from scratch, in about 10 minutes.  I dont know how long it would take a very skilled iPhone developer to write MoveMe on that iPhone from scratch, but if I was to write it on Silverlight in the same way (e.g. all via code), I think it would likely take me at least an hour or two to get it all working right, maybe more if I ended up picking the wrong strategy or couldnt get the math right, etc. Making Some Tweaks Silverlight contains a feature called Projections to do a variety of 3D-like effects with a 2D surface. So lets play with that a bit. Go back to Blend and select the welcome Border in the object tree.  In its properties, scroll down to the bottom, open Transform, and see Projection at the bottom.  Set X,Y,Z to 90.  Youll see the element kind of disappear, replaced by a thin blue line. Now Create a new animation called startupStoryboard. Set its key time to .5 seconds in the timeline view Set the projection values above to 0 for X, Y, and Z. Save Go back to Visual Studio, and in the constructor, add the following bold code (lines 7-9 to the constructor: 1: public MainPage() 2: { 3: InitializeComponent(); 4:   5: SupportedOrientations = SupportedPageOrientation.Portrait; 6:   7: this.Loaded += (s, e) => 8: { 9: startupStoryboard.Begin(); 10: }; 11: } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } If the code above looks funny, its using something called a lambda in C#, which is an inline anonymous method.  Its just a handy shorthand for creating a handler like the manipulation ones above. So with this youll get a nice 3D looking fly in effect when the app starts up.  Here it is, in flight: Pretty cool!Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • jquery: Why do opacity animations only work with FF?

    - by incrediman
    I'm wondering why opacity animations only work with Firefox, and not with chrome or internet explorer. For example, jQuery("#a").fadeTo(1000,1); fades the element in with firefox, but just makes it appear with Chrome or IE. All I want is for the element to fade in. How can I get this to work with IE and chrome? Edit: Same thing if I use fadeIn() or any other similar function, like show()

    Read the article

  • I've only programmed in AS3; What's the easiest practice in Flash CS4 to create simple animations?

    - by Zando
    So I've been using Flash for awhile, but rarely ever use the authoring tool. I want to create a quick little slideshow in which a user clicks buttons, and assets on the screen fade in an out as you move from slide to slide. I don't want to do this programatically...what's the quickest route to go about doing this, with using some AS3 but primarily relying on CS4's authoring tools? I remember when I first learned flash, years ago, you placed elements on stage and stretched them out over multiple frames. That seems like a lot of work...I'd rather just have, say, 10 total frames, each frame being a step in the slideshow, and each click of the next button going to that next frame, with each frame having its own animations.

    Read the article

  • SimpleModal and Jquery (How to do open and closing animations)?

    - by matthewsteiner
    http://www.ericmmartin.com/projects/simplemodal/ There's two examples near the bottom of the page that show how to either do open or closing animations. I'm pretty new to jquery. How can I declare both onOpen and onClose? (I've only been able to get one to work at a time. jQuery(function ($) { $('a.basic').click(function (e) { e.preventDefault(); $('#basic-modal-content').modal( { onClose: function (dialog) { dialog.container.fadeOut('slow', function () { }); } } ); }); }); Thanks for any help you can provide.

    Read the article

  • WPF: Turning off animations, data binding temporarly for invisible objects?;)

    - by TomTom
    I have a window that contains a tab control - basically multiple sheets with visualizations on them. The visualtizations are: possible very resource intensive during rendering relying on constant data updates to update their underlying models Obviously only one sheet can be visible every time ;) Anyone knows of a good way to turn off all visualization, animations, data binding for a control / panel and it's contained controls? If I would find a way to do that, I could simply turn off all the invisible sheets and reactivate them as needed. The models must be kept running - some of the visual stuff is pretty complex and really relies on constant data updates, and recalculating it when someone switches tabs would be too hard.

    Read the article

  • jQuery - How to Prevent Animation Queue Buildup with Double Animations?

    - by Jason
    Hello, I was taking a look at this tutorial here to prevent animation buildups: http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup My situation: I am doing a double animation like this below, and would like the prevent the animation build up. Since I have 2 animations going, it seems it ignores the .stop(). What can be done to prevent this? I have tried .stop() on both .animate and if I do that it stops animating... $(document).ready(function() { $('#element').hover(function() { $(this).stop() .animate( { left: 200 }, { duration: 'slow', }) .animate( { top: 200 }, { duration: 'slow', }); } , function() { $(this).stop() .animate( { left: 0 }, { duration: 'slow', }) .animate( { top: 0 }, { duration: 'slow', }); }); }); Any help will be greatly aprecaited!!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >