Drawing a shadow on CCLabelTTF - cocos2d-iphone

I am drawing a shadow on a CCLableTTF using CGContextSetShadowWithColor. I have set the colour to be white but i always get a grey/black line around the edge of the shadow.
Is there anyway to remove the outline, i have looked but i cannot see any stroke colour for the shadow.
Thanks

Related

How to change draw order of MFC graph elements

I am trying to modify the look of the graph displayed to have a white background with black axes.
However, simply modifying the RGB values of
m_OScopeCtrl.SetBackgroundColor(RGB(0, 64, 0)) ;
m_OScopeCtrl.SetGridColor(RGB(192, 255, 192)) ;
m_OScopeCtrl.SetPlotColor(RGB(255, 255, 255)) ;
in “TestOScopeDlg.cpp” doesn’t seem to do the trick, the entire graph just turns white and the plots disappear (presumably being hidden by the white background).
Link to source code on codeproject.
http://www.codeproject.com/Articles/241/Oscilloscope-StripChart-Control
How can I make the graph appear with a white background and black axes?
Found the answer. Changing SRCPAINT to SRCAND works.
It seems SRCPAINT works when trying to overlay a light color on top of a dark color and SRCAND works when trying to overlay a dark color on top of a light color.

Colour map in Qt

I am new to Qt. I am trying to make a simple map like in the picture bellow, and color each slot a different color based on some value calculated by my program. Then when I tick a checkbox, the value will be displayed on the slot on top of the color. So how can I do this? Any pointing is greatly appreciated.
The trick to drawing such figures is to realize that it's possible to draw a single pixel multiple times.
Each slot is a rectangle, drawn in either white or a color.
On top of those rectangles, you draw the following things:
A grid of black lines
A black circle (not filled)
A number of white circles, around the black circle.
The last step erases colored pixels outside the circle from step 2.

OpenGL: blend is disable, but still blending

I try to render an object, but I don't want its edge blend with the background.
I use only 2 colors: red for the object, and white for the background.
When I get the pixels of the frame with glReadPixel() I see that there are other colors except for
red and white, a blending colors. These colors are located on the edges of the object.
Eventually, I need to get a picture of 2 colors only.
Someone can help me to solve this?
(note: I used glDisable(GL_BLEND) to make sure it didn't work)

"Lantern effect" or show only a part of a scene

I'm trying to show only a part of a background image (game scenenario in the future). The basic way to work is for example, first I draw a background image, after that i need to "hide"/cover the image with some dark or darness (no light, don't know what option must be chosen) and use the mouse click to using a circle or a triangle (my options) show only the part of the image background over with the circle/triangle centered on mouse position. I called this "lantern effect".
First Option: Play with the alpha channel, creating a an square covering all the window size and after that trying to substract the circle area over the alpha square over the image.
Second Option: Play again with a black square covering all the image background and trying to substract a circle/triangle. Try with glLogicOp but this method only plays mixing colors. Don't know how to do operation with 2D polygons with OpenGL.
...
Any other idea or easy example to learn how to do something similar.
Image example:
That's quite easy to achieve actually:
Create black texture with your lantern light shape in Alpha channel. (Texture could be animated)
Render background.
Render Lantern texture centered at your in-game mouse cursor.
Render black padding around the lantern texture to hide everything around till screen edges.
There's no need to use any special blending modes, just an overlay.

BlendFunc for textured fonts with changing background

I am attempting to use Textured fonts as so that I can display text in my openGL scene. However I am having trouble finding glBlendFunc values that will work.
The background that the text will be placed on is a grayscale image but will change throughout the execution. Because the background changes the text could possibly be on top of any color from black to white.
The best values I have found are glBlendFunc(Gl.GL_SRC_COLOR, Gl.GL_ONE_MINUS_SRC_ALPHA). This will make the black box surrounding the character disappear but the character itself will fade as the background goes towards white.
Please help!
Do you want the text to invert based on the background color? white text over black background, black text on white? I think you can achieve an invert via blendfunc.
Alternatively you can use a font texture which has a "border" built into it to help set the character apart from the background. Imagine a white font w/ a smooth alpha blended black "glow". The font will look good against almost all colors.