Create a custom PictureScrollField - blackberry

I want to create a custom PictureScrollField to manage the distance between the images. When using it, and specifying different HighlightStyles, I can obtain what I want but I want to change the space between the images. I didn't find any function to minimize the space between them or set it to 0 or -10 for example. How can I do this. I thought creating a custom PictureScrollField will resolve this but I don't know what I will have to put in the paint(Graphics) function. Using Super.paint will not make this.
So how can I realize this using PictureScrollField?
Thanks

Did you look at PictureScrollField.setImageDistance(int gap); ? It isn't available until OS 6.0 so if you are using OS 5.0 you may be out of luck.

Related

How to make Glitch/Static Effect Objective-c

I'm trying to make that effect, but I don't know how or the name
Of the effect?
That's not "an effect" but could be accomplished a few different ways. If it were me I'd look into Core Image filters (CIFIlters). If you've never used them, start with this Apple example:
https://developer.apple.com/library/prerelease/ios/samplecode/CIFunHouse/Introduction/Intro.html
Then look into changing the size and position of the type, applying pixellation and maybe a bit of blur.

How to set edge style on UILabel text

I'm working on adding custom captions to my iOS app that plays videos. I'd like to support all the features of CEA-708 (which are essentially rich-text captions), but I can't figure out how to apply the necessary edge-styles using a UILabel.
The image below shows the edge styles I want to support. However, I am struggling to find a way to achieve raised/depressed edges. Any ideas?
I don't think that those behaviors are expected in iOS. The only idea that I can suggest is to use two labels to achieve those effects, with different z-indexes and positions and colors to obtain the offset similar to the edge.
Otherwise, you can try to take a look to this link https://developer.apple.com/library/ios/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_shadows/dq_shadows.html.

Stretching a UIImage across the length of a UIBezierPath

What I basically need to achieve is a Fruit Ninja - style "slash" effect, where the "slash" trails the user's touch and follows the shape of the user's gesture, and is thinner the longer the distance the user has swiped.
The simplest way to achieve this seemed to be to collect all the points the user passes through in a UIBezierPath, and "stretch" an image through the length of the BezierPath. This would achieve the kind of "trailing" effect I was looking for and also ensure that the line is thinner if the distance travelled is longer.
However I can't seem to find a way to actually implement this. Is this even possible?
Alternatives? Thanks.
P.S: This is for a low-medium priority section of a regular app and not a game, so I would like to avoid having go down to OpenGL and spend a lot of time to achieve this (with completely custom drawing, etc). Something at the SDK level would be preferred, and if that's not possible at all, we'll just figure out a different UI.
Thanks!
For pretty easy-to-use stretching teqhniques of images/views you could look into
https://github.com/hfossli/AGGeometryKit/
I recommend trying to draw using CoreGraphics. See this link
http://www.effectiveui.com/blog/2011/12/02/how-to-build-a-simple-painting-app-for-ios/
Okay. Maybe you can use this.
https://github.com/hfossli/AGDraw
Just something I wrote a while ago. Hit clear and try to draw something (clear will toggle between two types of strokes). You'll see the width of the penstroke will increase with the velocity you use.. I guess that fits your need. If you fix some bugs, please make a pull request. You are free to use the code, but I will add a MIT license later.

Drawing a simple bar graph in ios, without using Coreplot

I have two sets of array containing 7 objects, with values in one and dates on another.
I would like to generate a simple bar graph with date on x axis and values on y axis.
I searched google and ofcourse stackoverflow, but I didn't find a satisfactory answer.
In every answer, it's all about Coreplot, which I don't want to use because of it's complexity(Me being a begineer in ios development).
Is there any other way except, CorePlot to achieve such graph? Or Can someone provide me an example to plot using inbuilt apple API'S
Awaiting an answer, Thanks a lot in advance.
You will need to do this inside a custom UIView.
In the drawRect method you can calculate the extent of the x-axis and the y-axis. You then need to draw the axes onto the actual screen with the numbers showing the values.
Then you need to work out how thick each bar should be and how tall they need to be.
Then draw them into their relevant spaces along the x-axis.
Before any of this though you need to give is a background colour. Maybe some guide lines so the user can easily read the values...
Or you can use http://www.cocoapods.org to install CorePlot and it will do it all for you.
It is MUCH MUCH MUCH MUCH more difficult to draw the graph yourself than it is sto spend a while learning how to use coreplot.
I tried using coreplot, but it is a giant framework which is too good and toodifficult for a begineer like me to consume. So I came across OVGraph, which is a basic framework that does all I want, And it is easy to use as well,
something like this :
OVGraphView *graphview=[[OVGraphView alloc]initWithFrame:CGRectMake(0, 0, 480, 300) ContentSize:CGSizeMake(960, 300)];
//customizations go here
[self.view addSubview:graphview];
[graphview setPoints:#[[[OVGraphViewPoint alloc]initWithXLabel:#"today" YValue:#3.2 ],[[OVGraphViewPoint alloc]initWithXLabel:#"yesterday" YValue:#4 ],[[OVGraphViewPoint alloc]initWithXLabel:#"3" YValue:#6 ]]];
generates beautiful graphs.
Another option can be EChart which has EColumnChart
This third party project worked nice for me and I found the design much better than most other projects. Unfortunately is paid, but it's always an option :)
http://www.binpress.com/app/ios-bar-chart-view/1836

Cool bubble effect using something like CCParticle in Cocos2d (no third party tools)

I would like to achieve a cool particle effect like in here.
The bubble should be similar to an explosion starting from the centre and expanding. I'd like to add an animated wave coming out from the left and right side of the bubble and looking like this. I guess I could use to two distinct animation and put together as I assume this has never been done in a Cocos2d game.
Also, I would like to avoid using non-Cocos2d tools as particle designer. In chapter 1 of the Cocos2d cookbook I found some cool particle examples and the code doesn't seem too complex. Instead, using third party tools I need to import their classes and use their file format to create particles and I have to pay. Even more there doesn't seem to be many particle effect files shared (at least not the ones I want).
Thanks a lot.
EDIT: I added a comment with a theory on how the first of the two animation could work.
Your best chance is with Particle Designer. You can modify the emitters in the library and visualize your changes. It's the easiest way to achieve a great effect. Once you find the combination of values that you like , you can simply create an emitter from code and set all those properties yourself. You don't have to pay or use any class (which you actually don't have to , it's already built in cocos2D) . So just download the free version of Particle Designer and then set the values from code. It's the same thing , it only takes a bit more work to do.

Resources