problem about shape-Collection of common programming errors


  • Deukalion
    xna rendering vertex shape
    What is the best way to create a VertexDeclaration, that makes it able to render a Shape consisting of vertices and also be able to store a color for the shape (in case the texture can’t be rendered – or in case we want color instead of a texture) – instead of having both a VertexPositionNormalTexture and a VertexPositionColor struct in the same class/struct.I’m trying this approach:public interface IShape : IVertexType { }public struct ShapeFace {public int Count { get; set; }public Color Color

  • ved
    java box2d libgdx shape body
    need some support. I am novice in libgdx game engine. Below is my code package com.game.box2d.fruitcart;import com.badlogic.gdx.Game; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.audio.Music; import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.graphics.GL10; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.m

  • shiami
    android textview shape
    I’m using shape attribute like this:<?xml version=”1.0″ encoding=”utf-8″?> <shapexmlns:android=”http://schemas.android.com/apk/res/android”android:shape=”rectangle”android:padding=”10dp”> <solidandroid:color=”#FFFFFF” /> <cornersandroid:bottomRightRadius=”15dp”android:bottomLeftRadius=”15dp”android:topLeftRadius=”15dp”android:topRightRadius=”15dp” /> </shape>and<TextViewandroid:layout_width=”wrap_content”android:layout_height=”wrap_content”android:background=”@dr

  • user2685747
    libgdx shape circle
    I’ve been searching for answer for about 2 hours now and I haven’t found my desired answer. My question is, Is it possible, and how, to draw a circle-shaped texture, so that outside the circle, texture would be transparent, is it even possible? Thanks in advance! This site has been a great help so far!

  • KingsInnerSoul
    android xml shape
    I have an xml file called border.xml in the drawable folder. In this xml I have <!– +++++++++++++++++++++ BORDER +++++++++++++++++++ –> <item> <shape android:shape=”rectangle”><solidandroid:id=”@+id/shape_border_color” android:color=”@color/black” /> <gradient android:id=”@+id/shapre_border_gradient” android:startColor=”@color/BurlyWood” android:endColor=”@color/Blue” android:angle=”270″/> <!– ++++++++++++++++++++ ROUND CORNERS ++++++++++++++++++++++++++++

  • nathan
    android android-xml shape
    I’d like to create a rectangle shape with two solid colors (horizontally) to achieve something like this:I heard about layer-list, i though i could use it to contains two rectangle with a different color but it seems that it only lays shapes vertically.Is there a way to achieve this using lalyer-list or should i use something totally different? I’d like to keep it simple with ability to change the shape colors at runtime.Thanks.

  • phil13131
    c# wpf grid shape
    I have a small problem with the visibility of an ellipse.In runtime I create an Shapes.Ellipse object and connect it to a grid with grid1.Children.Add(ellip). To control the position of the ellipse I use:ellip.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; ellip.VerticalAlignment = System.Windows.VerticalAlignment.Top; ellip.Margin = new Thickness(a,b,0,0); ellip.Height = 100; ellip.Width = 100;In runtime I now keep changing the position within the grid (by changing a and b) but

  • H.B.
    c# .net wpf shape
    It won’t change the position, the position is fixed at runtime even though i change the value 50 below:System.Windows.Shapes.Rectangle myRectangle = new System.Windows.Shapes.Rectangle();mainGrid.Children.Add(myRectangle);Canvas.SetLeft(myRectangle, 50); Canvas.SetTop(myRectangle, 50);myRectangle.Height = 100; myRectangle.Width = 100;myRectangle.Stroke = System.Windows.Media.Brushes.LightSteelBlue;

  • inazaruk
    android button imagebutton shape
    I’m trying to design a button for an android application like this:The length of the button will be determined based on the size of the text. The text will change during runtime depending on the page the button is displayed on. Does anyone have an idea on how I can achieve this?

  • Andy
    actionscript-3 sprite shape fxg
    I can import FXG files as Sprites as follows:import graphics.mypic; // graphics/mypic.fxg var mysprite:Sprite = new mypic();I don’t always need the fancy things that come with Sprites. How can I import them to Shapes?

  • Mark Worsnop
    android shape stroke
    I need to change the stroke color from the app. The user is able to change the background color so I need to also let them change the stroke (outline) of the button. As its is already set in the drawable (sample below) I have not found a way to change this. Seems like all of the other questions like this just said to use the XML file…. but that doesnt let me make it dynamic. Thank you for any help!I need to change the stroke color to a user defined color. Nothing to do with the state.<?x

  • yuri
    flash actionscript-3 runtime shape stroke
    I’ve got a complicated shape in a MovieClip. Runtime i want to change the stroke width of this Shape depending on a size ratio.How can I change this property without redrawing the entire Shape with the drawing API (almost impossible, is a map with very detailed borders) ?Is it possible ?

  • Deukalion
    xna c# textures blending shape
    What is the best way to render a texture overlapping effect?Like in this example:I want either the grass to fade in to the snow texture, or the other way around. No rough edges. Somehow make them blend over. So the grass has a bit of snow or the snow has a bit of grass How is this possible during runtime? If that’s possible.I don’t render this by using the SpriteBatch, since the ground isn’t rectangles (they can be moved).This is the way I render each shape (each one of those squares):// LoadTex

  • userSeven7s
    android android-layout monodroid shape
    I have <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android”android:shape=”rectangle”><solidandroid:color=”#FFFF00″ /><padding android:left=”7dp”android:top=”7dp”android:right=”7dp”android:bottom=”7dp” /> </shape><TextViewandroid:background=”@drawable/test”android:layout_height=”45dp”android:layout_width=”100dp”android:text=”Moderate” />So now I want this shape to change colors based on information I get back

  • Arif
    html5 kineticjs shape
    I am trying to make KineticJs html 5 custom shape.But it is not working in Google chrome. Not draggable in Firefox and also shape are not same in size.Can anybody tell why?live code http://jsfiddle.net/prantor19/wGE2a/8/var stage = new Kinetic.Stage({container: ‘canvas-container’,width: 500,height: 500, });var layer = new Kinetic.Layer();drawWindow = function(canvas) {var context = canvas.getContext();context.beginPath();context.moveTo(this.attrs.x,this.attrs.y);context.lineTo(this.attrs.width,

  • smci
    r indexing data.frame shape logical-operators
    I’m having some trouble indexing data.frames in R. I’m an R beginner. I have a data.frame called d which has 35512 columns and 77 rows. I have a list called rd which contains 35512 elements. I’d like all the columns of d which correspond to the items in rd less than 100. Here’s what I’m doing:# just to prove I’m not crazy > length(colnames(d)) [1] 35512 > length(rownames(d)) [1] 77 > length(rd) [1] 35512 # find all the elements of rd less than 100 (+ unnecessary faffing?) > i <- u

  • Neil
    orchardcms shape
    I have Orchard 1.5.1.0 installed. I have Orchard running in VS2010. Shape Tracing is enabled, URL Alternate is enabled, Widget Alternate is enabled. I have these ASP packages installed: ASP.NET MVC 2, 3 and 4; ASP.NET MVC2 VS 2010 Tools, ASP.NET MVC3 VS 2010 Tools Update, ASP.NET Web Pages, ASP.NET Web Pages – VS 2010 Tools.The Problem: When I use Shape Tracer; Model, Placement, Template, HTML all work, but Shape does not. Clicking on Shape produces no change in the Shape Tracer. Therefore I

  • Art
    javascript three.js webgl typescript shape
    As the title says; I’m trying to collapse multiple shapes into one group. The relevant code I’m using is roughly as follows;public toShape():THREE.ShapeGeometry {var combinedShape:THREE.ShapeGeometry;for(var i = 0; i < this.points.length; ++i) //this.points contains multiple shapes{var shape = new THREE.Shape();for(var j = 0; j < this.points[i].length; ++j)/* this.points[i] contains the actual points of a separate shape */{switch(this.points[i][j][‘type’]){/* every shape starts with a move

  • Ilia Rostovtsev
    arrays undefined shape kineticjs
    I’m fairly new to javascript and kinetic-js. A while ago I created a script containing a Shape with Kinetic-js 3.9.0. It was something like this (just the relevant code):popup = new Kinetic.Shape({drawFunc: function() {item = itemlist[0];},itemlist: [] }With 3.9.0 that worked in Firefox, but as of 3.9.2 it doesn’t work any more. Ther error console gives the message “TypeError: popup.itemlist is undefined”.What am I doing wrong?

  • ThaMe90
    android drawable shape
    I want to set the background of the standard TextView in an Android project to a custom shape. The shape is defined as follows:<?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android”android:shape=”rectangle” ><gradient android:type=”radial”android:angle=”90″android:startColor=”#FF1EFFFF”android:endColor=”#B01E90FF”android:centerColor=”#201E90FF”android:centerX=”0.5″android:centerY=”1.0″ /></shape>I try to set the custom sha

  • Ring
    java android xml layout shape
    For some reason my Android project compiles properly, runs fine on both phones and emulators, and even includes multiple XML layout files with LinearLayouts, TextViews, Buttons, Images, and even custom View components, but when it comes to shapes it simply can’t find them.Heres my code:<?xml version=”1.0″ encoding=”utf-8″?> <shapexmlns:android=”http://schemas.android.com/apk/res/android”android:shape=”rectangle”android:layout_width=”fill_parent”android:layout_height=”fill_parent”><

Web site is in building