Search Results

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

Page 10/31 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Spritebatch drawing sprite with jagged borders

    - by Mutoh
    Alright, I've been on the making of a sprite class and a sprite sheet manager, but have come across this problem. Pretty much, the project is acting like so; for example: Let's take this .png image, with a transparent background. Note how it has alpha-transparent pixels around it in the lineart. Now, in the latter link's image, in the left (with CornflowerBlue background) it is shown the image drawn in another project (let's call it "Project1") with a simpler sprite class - there, it works. The right (with Purple background for differentiating) shows it drawn with a different class in "Project2" - where the problem manifests itself. This is the Sprite class of Project1: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; namespace WindowsGame2 { class Sprite { Vector2 pos = new Vector2(0, 0); Texture2D image; Rectangle size; float scale = 1.0f; // --- public float X { get { return pos.X; } set { pos.X = value; } } public float Y { get { return pos.Y; } set { pos.Y = value; } } public float Width { get { return size.Width; } } public float Height { get { return size.Height; } } public float Scale { get { return scale; } set { if (value < 0) value = 0; scale = value; if (image != null) { size.Width = (int)(image.Width * scale); size.Height = (int)(image.Height * scale); } } } // --- public void Load(ContentManager Man, string filename) { image = Man.Load<Texture2D>(filename); size = new Rectangle( 0, 0, (int)(image.Width * scale), (int)(image.Height * scale) ); } public void Become(Texture2D frame) { image = frame; size = new Rectangle( 0, 0, (int)(image.Width * scale), (int)(image.Height * scale) ); } public void Draw(SpriteBatch Desenhista) { // Desenhista.Draw(image, pos, Color.White); Desenhista.Draw( image, pos, new Rectangle( 0, 0, image.Width, image.Height ), Color.White, 0.0f, Vector2.Zero, scale, SpriteEffects.None, 0 ); } } } And this is the code in Project2, a rewritten, pretty much, version of the previous class. In this one I added sprite sheet managing and, in particular, removed Load and Become, to allow for static resources and only actual Sprites to be instantiated. using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; namespace Mobby_s_Adventure { // Actually, I might desconsider this, and instead use static AnimationLocation[] and instanciated ID and Frame; // For determining the starting frame of an animation in a sheet and being able to iterate through // the Rectangles vector of the Sheet; class AnimationLocation { public int Location; public int FrameCount; // --- public AnimationLocation(int StartingRow, int StartingColumn, int SheetWidth, int NumberOfFrames) { Location = (StartingRow * SheetWidth) + StartingColumn; FrameCount = NumberOfFrames; } public AnimationLocation(int PositionInSheet, int NumberOfFrames) { Location = PositionInSheet; FrameCount = NumberOfFrames; } public static int CalculatePosition(int StartingRow, int StartingColumn, SheetManager Sheet) { return ((StartingRow * Sheet.Width) + StartingColumn); } } class Sprite { // The general stuff; protected SheetManager Sheet; protected Vector2 Position; public Vector2 Axis; protected Color _Tint; public float Angle; public float Scale; protected SpriteEffects _Effect; // --- // protected AnimationManager Animation; // For managing the animations; protected AnimationLocation[] Animation; public int AnimationID; protected int Frame; // --- // Properties for easy accessing of the position of the sprite; public float X { get { return Position.X; } set { Position.X = Axis.X + value; } } public float Y { get { return Position.Y; } set { Position.Y = Axis.Y + value; } } // --- // Properties for knowing the size of the sprite's frames public float Width { get { return Sheet.FrameWidth * Scale; } } public float Height { get { return Sheet.FrameHeight * Scale; } } // --- // Properties for more stuff; public Color Tint { set { _Tint = value; } } public SpriteEffects Effect { set { _Effect = value; } } public int FrameID { get { return Frame; } set { if (value >= (Animation[AnimationID].FrameCount)) value = 0; Frame = value; } } // --- // The only things that will be constantly modified will be AnimationID and FrameID, anything else only // occasionally; public Sprite(SheetManager SpriteSheet, AnimationLocation[] Animations, Vector2 Location, Nullable<Vector2> Origin = null) { // Assign the sprite's sprite sheet; // (Passed by reference! To allow STATIC sheets!) Sheet = SpriteSheet; // Define the animations that the sprite has available; // (Passed by reference! To allow STATIC animation boundaries!) Animation = Animations; // Defaulting some numerical values; Angle = 0.0f; Scale = 1.0f; _Tint = Color.White; _Effect = SpriteEffects.None; // If the user wants a default Axis, it is set in the middle of the frame; if (Origin != null) Axis = Origin.Value; else Axis = new Vector2( Sheet.FrameWidth / 2, Sheet.FrameHeight / 2 ); // Now that we have the axis, we can set the position with no worries; X = Location.X; Y = Location.Y; } // Simply put, draw the sprite with all its characteristics; public void Draw(SpriteBatch Drafter) { Drafter.Draw( Sheet.Texture, Position, Sheet.Rectangles[Animation[AnimationID].Location + FrameID], // Find the rectangle which frames the wanted image; _Tint, Angle, Axis, Scale, _Effect, 0.0f ); } } } And, in any case, this is the SheetManager class found in the previous code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; namespace Mobby_s_Adventure { class SheetManager { protected Texture2D SpriteSheet; // For storing the sprite sheet; // Number of rows and frames in each row in the SpriteSheet; protected int NumberOfRows; protected int NumberOfColumns; // Size of a single frame; protected int _FrameWidth; protected int _FrameHeight; public Rectangle[] Rectangles; // For storing each frame; // --- public int Width { get { return NumberOfColumns; } } public int Height { get { return NumberOfRows; } } // --- public int FrameWidth { get { return _FrameWidth; } } public int FrameHeight { get { return _FrameHeight; } } // --- public Texture2D Texture { get { return SpriteSheet; } } // --- public SheetManager (Texture2D Texture, int Rows, int FramesInEachRow) { // Normal assigning SpriteSheet = Texture; NumberOfRows = Rows; NumberOfColumns = FramesInEachRow; _FrameHeight = Texture.Height / NumberOfRows; _FrameWidth = Texture.Width / NumberOfColumns; // Framing everything Rectangles = new Rectangle[NumberOfRows * NumberOfColumns]; int ID = 0; for (int i = 0; i < NumberOfRows; i++) { for (int j = 0; j < NumberOfColumns; j++) { Rectangles[ID] = new Rectangle ( _FrameWidth * j, _FrameHeight * i, _FrameWidth, _FrameHeight ); ID++; } } } public SheetManager (Texture2D Texture, int NumberOfFrames): this(Texture, 1, NumberOfFrames) { } } } For even more comprehending, if needed, here is how the main code looks like (it's just messing with the class' capacities, nothing actually; the result is a disembodied feet walking in place animation on the top-left of the screen and a static axe nearby): using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; using System.Threading; namespace Mobby_s_Adventure { /// <summary> /// This is the main type for your game /// </summary> public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; static List<Sprite> ToDraw; static Texture2D AxeSheet; static Texture2D FeetSheet; static SheetManager Axe; static Sprite Jojora; static AnimationLocation[] Hack = new AnimationLocation[1]; static SheetManager Feet; static Sprite Mutoh; static AnimationLocation[] FeetAnimations = new AnimationLocation[2]; public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; this.TargetElapsedTime = TimeSpan.FromMilliseconds(100); this.IsFixedTimeStep = true; } /// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here base.Initialize(); } /// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // Loading logic ToDraw = new List<Sprite>(); AxeSheet = Content.Load<Texture2D>("Sheet"); FeetSheet = Content.Load<Texture2D>("Feet Sheet"); Axe = new SheetManager(AxeSheet, 1); Hack[0] = new AnimationLocation(0, 1); Jojora = new Sprite(Axe, Hack, new Vector2(100, 100), new Vector2(5, 55)); Jojora.AnimationID = 0; Jojora.FrameID = 0; Feet = new SheetManager(FeetSheet, 8); FeetAnimations[0] = new AnimationLocation(1, 7); FeetAnimations[1] = new AnimationLocation(0, 1); Mutoh = new Sprite(Feet, FeetAnimations, new Vector2(0, 0)); Mutoh.AnimationID = 0; Mutoh.FrameID = 0; } /// <summary> /// UnloadContent will be called once per game and is the place to unload /// all content. /// </summary> protected override void UnloadContent() { // TODO: Unload any non ContentManager content here } /// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { // Allows the game to exit if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); // Update logic Mutoh.FrameID++; ToDraw.Add(Mutoh); ToDraw.Add(Jojora); base.Update(gameTime); } /// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.Purple); // Drawing logic spriteBatch.Begin(); foreach (Sprite Element in ToDraw) { Element.Draw(spriteBatch); } spriteBatch.Draw(Content.Load<Texture2D>("Sheet"), new Rectangle(50, 50, 55, 60), Color.White); spriteBatch.End(); base.Draw(gameTime); } } } Please help me find out what I'm overlooking! One thing that I have noticed and could aid is that, if inserted the equivalent of this code spriteBatch.Draw( Content.Load<Texture2D>("Image Location"), new Rectangle(X, Y, images width, height), Color.White ); in Project2's Draw(GameTime) of the main loop, it works. EDIT Ok, even if the matter remains unsolved, I have made some more progress! As you see, I managed to get the two kinds of rendering in the same project (the aforementioned Project2, with the more complex Sprite class). This was achieved by adding the following code to Draw(GameTime): protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.Purple); // Drawing logic spriteBatch.Begin(); foreach (Sprite Element in ToDraw) { Element.Draw(spriteBatch); } // Starting here spriteBatch.Draw( Axe.Texture, new Vector2(65, 100), new Rectangle ( 0, 0, Axe.FrameWidth, Axe.FrameHeight ), Color.White, 0.0f, new Vector2(0, 0), 1.0f, SpriteEffects.None, 0.0f ); // Ending here spriteBatch.End(); base.Draw(gameTime); } (Supposing that Axe is the SheetManager containing the texture, sorry if the "jargons" of my code confuse you :s) Thus, I have noticed that the problem is within the Sprite class. But I only get more clueless, because even after modifying its Draw function to this: public void Draw(SpriteBatch Drafter) { /*Drafter.Draw( Sheet.Texture, Position, Sheet.Rectangles[Animation[AnimationID].Location + FrameID], // Find the rectangle which frames the wanted image; _Tint, Angle, Axis, Scale, _Effect, 0.0f );*/ Drafter.Draw( Sheet.Texture, Position, new Rectangle( 0, 0, Sheet.FrameWidth, Sheet.FrameHeight ), Color.White, 0.0f, Vector2.Zero, Scale, SpriteEffects.None, 0 ); } to make it as simple as the patch of code that works, it still draws the sprite jaggedly!

    Read the article

  • Animation on the iPhone - use image sequence or rotation?

    - by user157733
    I am creating a basic animation for my iPhone app. I have a choice to make between 2 different types of animation. I can use this... NSArray *myImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"myImage1.png"], [UIImage imageNamed:@"myImage2.png"], [UIImage imageNamed:@"myImage3.png"], [UIImage imageNamed:@"myImage4.gif"], nil]; UIImageView *myAnimatedView = [UIImageView alloc]; [myAnimatedView initWithFrame:[self bounds]]; myAnimatedView.animationImages = myImages; myAnimatedView.animationDuration = 0.25; [self addSubview:myAnimatedView]; [myAnimatedView release]; or something like this... [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1.5]; // other animations goes here myImage.transform = CGAffineTransformMakeRotation(M_PI*0.5); // other animations goes here [UIView commitAnimations]; I have quite a few of these parts to animate so I want to choose an option which uses the least amount of memory and runds the quickest. Any advice would be great, thanks

    Read the article

  • How to unset delegate on UIView setAnimationDelegate: call?

    - by morticae
    I am receiving crash reports that appear to be from a UIView animation calling a delegate that has been dealloced. Thread 0 Crashed: 0 libobjc.A.dylib 0x334776f6 objc_msgSend + 18 1 UIKit 0x31c566c4 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] 2 UIKit 0x31c565d2 -[UIViewAnimationState animationDidStop:finished:] 3 QuartzCore 0x30045a26 run_animation_callbacks I am setting the current view controller as the delegate for animations using the following pattern: [UIView beginAnimations:nil context:NULL]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationDuration:0.5]; [UIView setAnimationDelegate:self]; ... [UIView commitAnimations]; My question is, how do I set that delegate reference to nil in my dealloc method? Is there some way to retain a reference to an animation? Or fetch animations in progress?

    Read the article

  • UIView Animation: Shrink

    - by Moduspwnens
    I'm looking to have my main view shrink to reveal the next view in the same way the Facebook app's views shrink when you press the top-left button. I already have it working with one of the included animations like this: [UIView beginAnimations:nil context:nil]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:1.0]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO]; [self.navigationController popToRootViewControllerAnimated:YES]; [UIView commitAnimations]; I'm fairly well-experienced with the iPhone SDK but haven't spent a lot of time with UIView animations.

    Read the article

  • Unobtrusive Toggling failing in Rails

    - by sscirrus
    I've been at this for hours but it just isn't working. I'm trying to get ToggleJS working using Scriptaculous' Effects library. Specifically, the example: http://wiseheartdesign.com/page_attachments/0000/0075/demo.html. I got it working beautifully using a pure html file called new.html. I then converted it to new.html.erb so I can incorporate some of the animations into my Rails project and it stopped working! I tried both html and ruby javascript tags but neither are working, for example: <%= javascript_include_tag "application", "prototype", "effects", "lowpro", "toggle" %> The page's body is displaying on the browser, but without animations. I have made sure my javascript files are the same as the demo (plus, the html file is working with them anyway). Do you know where the problem might lie here with my .erb file?

    Read the article

  • Core Animation performance on iphone

    - by nico
    I'm trying to do some animations using Core Animation on the iphone. I'm using CABasicAnimation on CALayer. It's a straight forward animation from a random place at the top of the screen to the bottom of the screen at random speed, I have 30 elements that doing the same animation continuously until another action happens. But the performance on the iPhone 3G is very sluggish when the animations start. The image is only 8k. Is this the right approach? How should I change so it performs better. // image cached somewhere else. CGImageRef imageRef = [[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:name ofType:@"png"]] CGImage]; - (void)animate:(NSTimer *)timer { int startX = round(radom() % 320); float speed = 1 / round(random() % 100 + 2); CALayer *layer = [CALayer layer]; layer.name = @"layer"; layer.contents = imageRef; // cached image layer.frame = CGRectMake(0, 0, CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)); int width = layer.frame.size.width; int height = layer.frame.size.height; layer.frame = CGRectMake(startX, self.view.frame.origin.y, width, height); [effectLayer addSublayer:layer]; CGPoint start = CGPointMake(startX, 0); CGPoint end = CGPointMake(startX, self.view.frame.size.height); float repeatCount = 1e100; CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position"]; animation.delegate = self; animation.fromValue = [NSValue valueWithCGPoint:start]; animation.toValue = [NSValue valueWithCGPoint:end]; animation.duration = speed; animation.repeatCount = repeatCount; animation.autoreverses = NO; animation.removedOnCompletion = YES; animation.fillMode = kCAFillModeForwards; [layer addAnimation:animation forKey:@"position"]; } The animations are fired off using a NSTimer. animationTimer = [NSTimer timerWithTimeInterval:0.2 target:self selector:@selector(animate:) userInfo:nil repeats:YES]; [[NSRunLoop currentRunLoop] addTimer:animationTimer forMode:NSDefaultRunLoopMode];

    Read the article

  • Need some information about using cocos2d in iPad.

    - by srikanth rongali
    Hi, I need some information about using cocos2d in iPad. Can we use 2048x2048 sprite sheets ? I read in this form that we can use but with limitation not more than 3 or 4 sprite sheets. But, I have 10 animations in my game. maximum of 4 animations run at a time. Can we use the CCDirectors in AppDelegate in the same way as we use in iPhone ? if( ! [CCDirector setDirectorType:CCDirectorTypeDisplayLink] ) [CCDirector setDirectorType:CCDirectorTypeDefault]; [[CCDirector sharedDirector] setPixelFormat:kPixelFormatRGBA8888]; [CCTexture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA8888]; What can be the maximum size of the image that we can use? Any limitations regarding the cocos2d and iPad please post them. Thank you.

    Read the article

  • Animating Reloading of UITableView

    - by ustun
    I am trying to animate table rows in a UITableView in an iPhone project as I swipe across the screen to reload the data. When I disable animations and only call reloadData, table continues responding to swipe gestures. When I add animations with the reloadSections:WithRowAnimation: method, table stops responding to swipes, and only the navigation bar at the top responds to swipes. Another change is that, table starts responding to selection and I have to manually disable it again. I suspect these two issues might be related. I am using the swipe detection code over here btw: 1

    Read the article

  • WPF - databinding ObservableCollection CollectionChanged event?

    - by e0eight
    Hi, I have an observable collection implemented in my user control which indicates states of a device. Based on the collection change, the user control is to trigger animations(subscribe to collectionchanged event). The observable collection is implemented as a dependency property. In the application, I data bind the device states to the user control observableCollection using one-way databinding. When a new state is added in the application, I can see the ObservableCollection in the user control is updated. However, the CollectionChanged event never got fired, so no animations. Does anyone has an idea why this is so? Thank you in advance.

    Read the article

  • What is faster? Drawing or Compositing?

    - by mystify
    I make extensive use of -drawRect: to do some nice animations. A timer tries to fire 30 times per second with -setNeedsDisplay, but it feels like just 20 times. Also I can't use -setNeedsDisplayInRect: because the animation covers the entire thing. Would it help to take some of those drawing operations out of -drawRect: and move them to a subview? -drawRect has to do less then, but instead the OS will have more work with compositing views. Is there a rule of thumb which one is more worse? I remember from an apple text that they claimed Core Animation doesn't redraw during animation. So is that their secret of speed? Using subviews in animations?

    Read the article

  • iphone: repeating a transformation

    - by gonso
    Hi I'm trying to represent a view that rotates on the iphone screen. I have a button and when you press it, the view rotates 180 degrees. My problem is that this only works the first time. Here is the code: -(IBAction) flip:(id)sender{ CGAffineTransform transform; //the transform matrix to be used below //BEGIN ANIMATIONS [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:2.0]; //animate if (flag){ transform = CGAffineTransformMakeRotation( RADIANS(180) ); } else { transform = CGAffineTransformMakeRotation( RADIANS(-180) ); } flag = !flag; transform = CGAffineTransformTranslate(transform, 0, 0); self.mySuview.transform = transform; //COMMIT ANIMATIONS [UIView commitAnimations]; } The first time you click, the view spins alright, but when you click again NOTHING happens. No errors, no changes on the view. What am I missing? Thanks Gonso

    Read the article

  • What's the point of having to provide a cacheName for NSFetchedResultsController?

    - by dontWatchMyProfile
    NSFetchedResultsController *frc = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:moc sectionNameKeyPath:nil cacheName:@"Root"]; Why do we have to think about a cacheName? How important is this decision? What would happen if there are two NSFetchedResultsController instances using the exact same cacheName? Does that matter? Is that some kind of singleton stuff? Thinking about Core Animation, there's also this strange animationID parameter, but setting it to the exact same thing for dozens of simultaneous animations doesn't hurt the animations at all. So I guess it's probably the same thing here...or not?

    Read the article

  • UIView animation does not animate at first try?

    - by Bacalso Vincent
    Considering that my _palette's frame is like this: _palette.frame = CGRectMake(0,480,320,200); I have this code here to slide up/down a UIView: if(![_pallete superview]) { [self.view addSubview:_pallete]; [self.view insertSubview:_tempViewPaletteListener belowSubview:_pallete]; [UIView animateWithDuration:0.3 animations:^{ _pallete.top -= kPaletteHeight; } completion:^(BOOL isFinished) { }]; } else { [UIView animateWithDuration:0.3 animations:^{ _pallete.top += kPaletteHeight; } completion:^(BOOL isFinished) { [_tempViewPaletteListener removeFromSuperview]; [_pallete removeFromSuperview]; }]; } *the _tempViewPaletteListener is just a view with a tap gesture use to dismiss the palette* The problem is when I first try to run code here, the _palette view will just stiffly display right away. What I expected is, it should slide up the _palette view. Though it works fine after the first try

    Read the article

  • What is the proper way to change the UINavigationController transition effect

    - by Felipe Sabino
    I have seen lots of people asking on how to push/pop UINavigationControllers using other animations besides the default one, like flip or curl. The problem is that either the question/answer was relative old, which means the have some things like [UIView beginAnimations:] (example here) or they use two very different approaches. The first is to use UIView's transitionFromView:toView:duration:options:completion: selector before pushing the controller (with the animation flag set to NO), like the following: UIViewController *ctrl = [[UIViewController alloc] init]; [UIView transitionFromView:self.view toView:ctrl.view duration:1 options:UIViewAnimationOptionTransitionFlipFromTop completion:nil]; [self.navigationController pushViewController:ctrl animated:NO]; Another one is to use CoreAnimation explicitly with a CATransaction like the following: // remember you will have to have the QuartzCore framework added to your project for this approach and also add <QuartzCore/QuartzCore.h> to the class this code is used CATransition* transition = [CATransition animation]; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; transition.duration = 1.0f; transition.type = @"flip"; transition.subtype = @"fromTop"; [self.navigationController.view.layer removeAllAnimations]; [self.navigationController.view.layer addAnimation:transition forKey:kCATransition]; UIViewController *ctrl = [[UIViewController alloc] init]; [self.navigationController pushViewController:ctrl animated:NO]; There are pros and cons for both approaches. The first approach gives me a much cleaner code but restricts me from using animations like "suckEffect", "cube" and others. The second approach feels wrong just by looking at it. It starts by using undocumented transitions types (i.e. not present in the Common transition types documentation from CATransition Class Reference) which might get your app rejected from App Store (I mean might as I could not found any reference of apps being rejected because it was using this transactions, which I would also appreciate any clarification on this matter), but it gives you much more flexibility on your animations, as I can use other animation types such as "cameraIris", "rippleEffect" and so on. Regarding all that, do I really need to appeal for QuartzCore and CoreAnimation whenever I need a fancier UINavigationController transition? Is there any other way to accomplish the same effect using only UIKit? If not, will the use of string values like "flip" and "cube" instead of the pre-defined constants (kCATransitionFade, kCATransitionMoveIn, etc...) be an issue regarding my app approval in the App Store? Also, are there other pros and cons regarding both approaches that could help me deciding whether to choose each one of them?

    Read the article

  • Pulling .live() functionality out of jQuery

    - by Daniel
    I am writing a Firefox Add-On that currently is depending on jQuery for the following things: Selectors Animations A special .live("focus") hail-mary event-catching maneuver that happens to work with jQuery 1.4.2 (but not 1.4.4) jQuery isn't well suited for functioning inside XUL, and it's a miracle we've gotten this far with it. We're trying to remove the jQuery requirements, the first two are easy (animations are simple, and we can use .querySelector() instead of jQuery), but the .live has proven impossible to do on our own. I've tried reading the source code, but I haven't been able to piece it apart. What is the jQuery .live function doing? There's clearly a lot more going on than document.addEventListener("focus"/"focusin",function_to_pick_apart_events). What else is going on here?

    Read the article

  • 2D Game Help In XNA

    - by user22715
    I'm making a game in XNA called The Adventure Of The Very Hairy Princess Fairy. The game is a "Sidescroller/Platformer" like mario but there is a problem. How do I attack a wepon the the player texture and add animations so it looks like the player is holding the gun and It's not a floating image in front of the player? The player can kill with things like chainsaws playing as a very hairy princess fairy.

    Read the article

  • Silverlight Cream for March 10, 2010 - 2 -- #811

    - by Dave Campbell
    In this Issue: AfricanGeek, Phil Middlemiss, Damon Payne, David Anson, Jesse Liberty, Jeremy Likness, Jobi Joy(-2-), Fredrik Normén, Bobby Diaz, and Mike Taulty(-2-). Shoutouts: Shawn Wildermuth blogged that they posted My "What's New in Silverlight 3" Video from 0reDev Last Fall Shawn Wildermuth also has a post up for his loyal followers: Where to See Me At MIX10 Jonas Follesø has presentation materials up as well: MVVM presentation from NDC2009 on Vimeo Adam Kinney updated his Favorite Tool and Library Downloads for Silverlight From SilverlightCream.com: Styling Silverlight ListBox with Blend 3 In his latest Video Tutorial, AfricanGeek is animating the ListBox control by way of Expression Blend 3. Animating the Silverlight Opacity Mask Phil Middlemiss has written a Behavior that lets you turn a FrameworkElement into an opacity mask for it's parent container... check out his tutorial and grab the code. AddRange for ObservableCollection in Silverlight 3 Damon Payne has a post up discussing the problem with large amounts of data in an ObservableCollection, and how using AddRange is a performance booster. Easily rotate the axis labels of a Silverlight/WPF Toolkit chart David Anson blogged a solution to rotating the axis labels of a Silverlight and WPF chart. Persisting the Configuration (Updated) Jesse Liberty has a good discussion on the continuation of his HyperVideo Platform talking about what all he is needing from the database in the form of configuration information... including the relationships. Animations and View Models: IAnimationDelegate Check out Jeremy Likness' IAnimationDelegate that lets your ViewModel fire and respond to animations without having to know all about them. Button Style - Silverlight Jobi Joy converted a WPF control template into Silverlight... and you'll want to download the XAML he's got for this :) A Simple Accordion banner using ListBox Jobi Joy also has an Image Accordian created in Expression Blend... and it's a 'drop this XAML in your User Control' kinda thing... again, go grab the XAML :) WCF RIA Services Silverlight Business Application – Using ASP.NET SiteMap for Navigation Fredrik Normén has a code-laden post up on RIA Services and the ASP.NET SiteMap. He is using the Silverlight Business app template that comes with WCF RIA Services. A Simple, Selectable Silverlight TextBlock (sort of)... Bobby Diaz shares with us his solution for a Text control that can be copied from in the same manner 'normal' web controls can be. He also includes a link to another post on the same topic. Silverlight 4 Beta Networking. Part 11 - WCF and TCP Mike Taulty has another pair of video tutorials up in his Networking series. This one is on WCF over TCP Silverlight 4 Beta Networking. Part 12 - WCF and Polling HTTP Mike Taulty's 12th networking video tutorial is on WCF with HTTP polling duplex. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    MIX10

    Read the article

  • How can I load .FBX files?

    - by gardian06
    I am looking into options for the model assets for my game. I have gotten pretty good with Blender, and want to use C++/DirectX9 (don't need all the excess from 10+), but Blender 2.6 exports .fbx not .x (by nature) and supposedly what is exported from Blender to .x is not entirely stable. In short how do I import .fbx models (I can work around not having animations if I must) into DirectX9? Is there a middleware, or conversion tool that will maintain stability?

    Read the article

  • New Pluralsight Course: HTML5 Canvas Fundamentals

    - by dwahlin
      I just finished up a new course for Pluralsight titled HTML5 Canvas Fundamentals that I had a blast putting together. It’s all about the client and involves a lot of pixel manipulation and graphics creation which is challenging and fun at the same time. The goal of the course is to walk you through the fundamentals, start a gradual jog into the API functions, and then start sprinting as you learn how to build a business chart canvas application from scratch that uses many of the available APIs . It’s fun stuff and very useful in a variety of scenarios including Web (desktop or mobile) and even Windows 8 Metro applications. Here’s a sample video from the course that talks about building a simple bar chart using the HTML5 Canvas:   Additional details about the course are shown next.   HTML5 Canvas Fundamentals The HTML5 Canvas provides a powerful way to render graphics, charts, and other types of visual data without relying on plugins such as Flash or Silverlight. In this course you’ll be introduced to key features available in the canvas API and see how they can be used to render shapes, text, video, images, and more. You’ll also learn how to work with gradients, perform animations, transform shapes, and build a custom charting application from scratch. If you’re looking to learn more about using the HTML5 Canvas in your Web applications then this course will break down the learning curve and give you a great start!    Getting Started with the HTML5 Canvas Introduction HTML5 Canvas Usage Scenarios Demo: Game Demos Demo: Engaging Applications Demo: Charting HTML5 Canvas Fundamentals Hello World Demo Overview of the Canvas API Demo: Canvas API Documentation Summary    Drawing with the HTML5 Canvas Introduction Drawing Rectangles and Ellipses Demo: Simple Bar Chart Demo: Simple Bar Chart with Transforms Demo: Drawing Circles Demo: Using arcTo() Drawing Lines and Paths Demo: Drawing Lines Demo: Simple Line Chart Demo: Using bezierCurveTo() Demo: Using quadraticCurveTo() Drawing Text Demo: Filling, Stroking, and Measuring Text Demo: Using Canvas Transforms with Text Drawing Images Demo: Using Image Functions Drawing Videos Demo: Syncing Video with a Canvas Summary    Manipulating Pixels  Introduction Rendering Gradients Demo: Creating Linear Gradients Demo: Creating Radial Gradients Using Transforms Demo: Getting Started with Transform Functions Demo: Using transform() and and setTransform() Accessing Pixels Demo: Creating Pixels Dynamically Demo: Grayscale Pixels Animation Fundamentals Demo: Getting Started with Animation Demo: Using Gradients, Transforms, and Animations Summary    Building a Custom Data Chart Introduction Creating the CanvasChart Object Creating the CanvasChart Shell Code Rendering Text and Gradients Rendering Data Points Text and Guide Lines Connecting Data Point Lines Rendering Data Points Adding Animation Adding Overlays and Interactivity Summary     Related Courses:  

    Read the article

  • Ledge grab and climb in Unity3D

    - by BallzOfSteel
    I just started on a new project. In this project one of the main gameplay mechanics is that you can grab a ledge on certain points in a level and hang on to it. Now my question, since I've been wrestling with this for quite a while now. How could I actually implement this? I have tried it with animations, but it's just really ugly since the player will snap to a certain point where the animation starts.

    Read the article

  • Pixar Animation Techniques That Powered Movies Like Toy Story & Wall E

    - by Gopinath
    Pixar few of the worlds best animation movies like Toy Story, Cars, Wall E and A Bug Life. For those who love these movies and would like to know how Pixar makes the incredibly beautiful animations here is a two minutes video. This article titled,Pixar Animation Techniques That Powered Movies Like Toy Story & Wall E, was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • Simple Javascript Animation Framework

    A simple framework for performing simple animations in javascript....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

  • Code and Slides: Getting Started Building Windows 8 HTML/JavaScript Metro Apps

    - by dwahlin
    This presentation is from a talk I gave at the spring 2012 DevConnections conference. It covers some of the key topics you need to know to get started building Windows 8 HTML/JavaScript Metro apps including navigation options, UI surfaces that can be used, controls, data binding and templates, and animations. View more of my presentations here. Sample code shown in the presentation can be found here. A large number of samples are available in the Windows 8 SDK which can be found here.

    Read the article

  • Concevoir la prochaine génération d'interface utilisateur multiplateformes avec Qt, un article de Jo

    Les interfaces graphiques de nos applications évoluent. Les widgets classiques sont progressivement remplacés par des images, plus explicites, plus agréables à regarder et plus conviviales. Qt 4.6 a apporté de nombreux outils permettant de faciliter le développement de telles applications. Cet article présente comment intégrer facilement des animations, des effets graphiques et des machines à états dans vos applications : http://qt-quarterly.developpez.com/q...generation-ui/ Découvrez également d'autres techniques dans nos précédents tutoriels écrits par la rédaction de Developpez (http://qt.develop...

    Read the article

  • Opera 12 est arrivé, capture vidéo en HTML5 et accélération graphique pour tout le navigateur

    Opera 12 est arrivé capture vidéo en HTML5 et accélération graphique pour tout le navigateur Edit de la partie sur WebGL Opera 12 est de sortie. On passera rapidement sur la possibilité de customiser plus facilement le navigateur et on soulignera plutôt une utilisation expérimentale de l'accélération matérielle pour le rendu des pages web (et pas simplement les animations) et même pour l'affichage de son UI. Les deux pour un surf et un fonctionnement beaucoup plus rapides. Cette nouvelle fonctionnalité doit être activée en mettant à 1 le paramètre opera:config#UserPrefs|EnableHardwareAcceleration [IMG]http://ftp-developpez.c...

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >