Search Results

Search found 33969 results on 1359 pages for 'custom view'.

Page 19/1359 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Implementing scroll view that is much larger than the screen view with random images

    - by pulegium
    What I'm trying to do is to implement something like the fruit machine scroll view. Basically I have a sequence of images (randomly generated on the fly) and I want to allow the users to scroll through this line. There can fit approx 10 images on the screen, but the line is virtually unlimited. My question is what would be the best approach in implementing this? So far I've thought of having a UIImageView going across the screen (with width equal to the sum of 10 images) and the image associated with it would be a combination of 12 or so images, with two images falling out of the visible area, this would allow for smooth scrolling. If the user scrolls further, then I would reconstruct the image associated with the view so the new images are appended and the old one's are discarded. This image reconstruction business sounds bit complicated, so I was wondering if there's a more logical way to implement this. There's one more thing, I want to have two lines crossing each other with images, bit like conveyor belts crossing. If that makes any sense... Bit like below: V1 V2 H1 H2 H3 H4 H5 V4 V5 So if the vertical belt is moved it'd be like: V2 H3 H1 H2 V4 H4 H5 V5 V6 H1-H5, V1-V6 being automatically generated images. I'm not asking for the implementation code, just the thoughts on the principles how to implement this. Thanks!! :)

    Read the article

  • Custom Button on top of another custom button?

    - by Jim
    I'm trying to make two custom buttons in code. One that fills the full screen with a small button on top. The problem I'm having is the larger button is triggered when the smaller button is tapped. I've tried doing exactly the same thing with IB and it works. Is there some sort of trapping/masking method that I need to use with code? I've checked the documentation and not come across anything that would suggest why this is happening. CGRect bFrame = CGRectMake(0, 0, 320, 480); UIButton *cancelButton = [[UIButton alloc] init]; cancelButton = [UIButton buttonWithType:UIButtonTypeCustom]; cancelButton.frame = bFrame; [cancelButton setBackgroundColor:[UIColor clearColor]]; [cancelButton addTarget:self action:@selector(animate:) forControlEvents:UIControlEventTouchUpInside]; UIButton *priceButton = [[UIButton alloc] init]; priceButton.center = CGPointMake(228, 98); [priceButton addTarget:self action:@selector(callNumber:) forControlEvents:UIControlEventTouchUpInside]; [priceButton setTitle:@"BUY" forState:UIControlStateNormal]; //[cancelButton addSubview:priceButton]; [self.view addSubview:cancelButton]; [self.view bringSubviewToFront:priceButton];

    Read the article

  • Wordpress: Retriving posts of a specific custom category in a custom taxonomy

    - by Extrakun
    I am able to retrieve all the posts from a custom category with this call to WP_Query $q = new WP_Query(array( 'taxonomy' => 'jh-portfolio-category', 'term' => 0, 'post_type' => 'jh-portfolio' )); However, let say within the jh-portfolio-category taxonomy I have defined some sub-categories, how do I specify I wish to have posts from a specific sub-category? Changing the 'term' property to the term_id as presented in wp_term_taxonomy doesn't seem to work.

    Read the article

  • Who can change the View in MVC?

    - by Luke
    I'm working on a thick client graph displaying and manipulation application. I'm trying to apply the MVC pattern to our 3D visualization component. Here is what I have for the Model, View, and Controller: Model - The graph and it's metadata. This includes vertices, edges, and the attributes of each. It does not contain position information, icons, colors, or anything display related. View - This would commonly be called a scene graph. It includes the 3D display information, texture information, color information, and anything else that is related specifically to the visualization of the model. Controller - The controller takes the view and displays it in a Window using OpenGL (but it could potentially be any 3D graphics package). The application has various "layouts" that change the position of the vertices in the display. For instance, one layout may arrange the vertices in a circle. Is it common for these layouts to access and change the view directly? Should they go through the Controller to access the View? If they go through the Controller, should they just ask for direct access to the View or should each change go through the controller? I realize this is a bit different from the standard MVC example where there a finite number of Views. In this case, the View can change in an infinite number of ways. Perhaps I'm shattering some basic principle of MVC here. Thanks in advance!

    Read the article

  • Drupal Theming and custom variables in custom pages

    - by GaxZE
    hello, I have created a custom page which sits at site.com/user/me/soe now im trying to theme this page and have created a subsequent template file. however if i copy in any basic html into my template file, all it does is produce a white page with my text and abandons the sites structure i originally had. i was hoping somebody could help me understand preprocessing as i feel that is the way to solve this.

    Read the article

  • How to reference other documents in a couchDB view (joining like functionality)

    - by Surfrdan
    We have a CouchDB representation of an XML database which we use to power a javascript based frontend for manipulating the XML documents. The basic structure is a simple 3 level hierachy. i.e. A - B - C A: Parent doucument (type A) B: any number of child documents of parent type A C: any number of child documents of parent type B We represent these 3 document types in CouchDB with a 'type' attribute: e.g. { "_id":"llgc-id:433", "_rev":"1-3760f3e01d7752a7508b047e0d094301", "type":"A", "label":"Top Level A document", "logicalMap":{ "issues":{ "1":{ "URL":"http://hdl.handle.net/10107/434-0", "FILE":"llgc-id:434" }, "2":{ "URL":"http://hdl.handle.net/10107/467-0", "FILE":"llgc-id:467" etc... } } } } { "_id":"llgc-id:433", "_rev":"1-3760f3e01d7752a7508b047e0d094301", "type":"B", "label":"a B document", } What I want to do is produce a view which returns documents just like the A type but includes the label attribute from the B document within the logicalMap list e.g. { "_id":"llgc-id:433", "_rev":"1-3760f3e01d7752a7508b047e0d094301", "type":"A", "label":"Top Level A document", "logicalMap":{ "issues":{ "1":{ "URL":"http://hdl.handle.net/10107/434-0", "FILE":"llgc-id:434", "LABEL":"a B document" }, "2":{ "URL":"http://hdl.handle.net/10107/467-0", "FILE":"llgc-id:467", "LABEL":"another B document" etc... } } } } I'm struggling to get my head around the best way to perform this. It looks like it should be fairly simple though!

    Read the article

  • Android ImageButton / Custom-Button?

    - by user568306
    Hi everyone, I am new to android development. So far I could help myself in all matters by reading threads here on stackoverflow. Now I am stuck and need someones help. Unfortunately I am not allowed to post an image of a screenshot because I am a new mamber, so I try to descripe it. I have a Samsung Galasy S and the clock app that ships with it has an button called "+ Create alarm". I want to create a similar button for my app. I've been experimenting with ImageButton. I do know how to get that "+"-Icon onto an ImageButton, but only centered and without text. I guess this is a custom button. Does anyone know how to do this? Can I do it in xml or do I need to extend the view-class and make it my own view?

    Read the article

  • Manage more Images to move in View

    - by David Pollak
    hi everyone, I'm creating an app which has more UIImageView on a View, they should move normally from a side to the other. I have an issue: after entering the second image, the two UIImageView start to behave crazy (!) because they don' move freely, but they are like restricted in two different areas not touching each other even if I said different things the first thing that I want to do, is to let them move normally; this is the code I am using: `- (void)viewDidLoad { [super viewDidLoad]; pos = CGPointMake(14.0, 7.0); [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(onTimer) userInfo:nil repeats:YES]; }` - (void) onTimer { pallone.center = CGPointMake(pallone.center.x+pos.x, pallone.center.y+pos.y); if(pallone.center.x > 320 || pallone.center.x < 0) pos.x = -pos.x; if(pallone.center.y > 480 || pallone.center.y < 0) pos.y = -pos.y; } and for the other image that has to enter after: - (IBAction)spara{ cos = CGPointMake(8.0, 4.0); [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(inTimer) userInfo:nil repeats:YES]; } - (void)inTimer{ bomba.center = CGPointMake(bomba.center.x+pos.x, bomba.center.y+pos.y); if(bomba.center.x > 50 || bomba.center.x < 0) pos.x = -pos.x; if(bomba.center.y > 480 || bomba.center.y < 0) pos.y = -pos.y; } what should I change ? and if I'd like the images to move only in one way (y) ? how do I do this ? I know, I'm a newbie thanks in advance

    Read the article

  • .NET custom property attribute?

    - by ropstah
    EDIT: I'd better rephrase: How can I shift the GET-implementation of a Class property to a / using a custom attribute? (I've added instantation vars (classname, propertyname) to the attribute, however I'd rather have these automatically fetched ofcourse.) Public Class CustomClass <CustomAttributeClass(ClassName:="CustomClass", PropertyName = "SomeProperty")> _ Public Property SomeProperty() as String Get() as String //This implementation should be handled by the attribute class End Get Set(Byval value as String) Me._someProperty = value End Set End Property End Class Old question: I want to create a custom property attribute for classes. I can create a class derived from Attribute, and 'mark' the property with the attribute, but where to go from here? I have a repository where I can quickly get data based on the attributes values. I would like to generalize the behaviour of the property in the attribute but I don't know how to go from here... Any help would be greatly accepted! Public Class CustomDataAttribute : Inherits Attribute Private _name As String Public Sub New(ByVal name As String) Me.Name = name End Sub Property Name() As String Get Return _name End Get Set(ByVal value As String) Me._name = value End Set End Property End Class Public Class CustomClass <CustomDataAttribute(Name:="CustomField")> _ Public Property CustomField() End Property End Class

    Read the article

  • Custom IIdentity and passing data from an attribute to a controller

    - by DM
    Here's my scenario: I've successfully created a custom IIdentity that I pass to a GenericPrincipal. When I access that IIdentity in my controller I have to cast the IIdentity in order to use the custom properties. example: public ActionResult Test() { MyCustomIdentity identity = (MyCustomIdentity)User.Identity; int userID = identity.UserID; ...etc... } Since I need to do this casting for nearly every action I would like to wrap this functionality in an ActionFilterAttribute. I can't do it in the controller's constructor because the context isn't initialized yet. My thought would be to have the ActionFilterAttribute populate a private property on the controller that I can use in each action method. example: public class TestController : Controller { private MyCustomIdentity identity; [CastCustomIdentity] public ActionResult() { int userID = identity.UserID; ...etc... } } Question: Is this possible and how? Is there a better solution? I've racked my brain trying to figure out how to pass public properties that are populated in an attribute to the controller and I can't get it.

    Read the article

  • Custom Repeater with hiractial Databinding

    - by Dooie
    Im using a Custom NestedRepeater Control for ASP.NET which can be found on code project The source is in c# which i have converted to vb and plugged into my solution, so far so good. The problem, im having is databinding to the repeater, my code behind looks like this... '' get all pages Dim navPages As DataSet = Navigation.getMenuStructure() navPages.Relations.Add(navPages.Tables(0).Columns("ID"), navPages.Tables(0).Columns("ParentID")) NestedRepeaterNavigation.RelationName = RelationName NestedRepeaterNavigation.DataSource = navPages NestedRepeaterNavigation.RowFilterTop = "ParentID is null" NestedRepeaterNavigation.DataBind() Then in the item template of my custom repeater im trying the following... <ItemTemplate> <img src="/pix.gif" height="10" width="<%#(Container.Depth * 10)%>"> <%# (Container.DataItem as DataRow)["DESCRIPTION"]%> <%# (Container.NbChildren != 0 ? "<small><i>(" + Container.NbChildren.ToString() +")</i></small>" "") %><small><i></i></small> </ItemTemplate> The databinding falls over; firstly that 'as DataRow' says it was expecting an ')'. And secondly that '!=' identifier expected. Is this due to the translation from c#, should the databinding be different?

    Read the article

  • Building a custom (dynamic) dataset and grid

    - by marko.ivanovski.nz
    Hi, I'm in the process of building a dynamic table in which you can add/remove rows & columns so it varies in size depending on what the user wants. Its purpose is to store properties for a product, but there can be from 1 to 10 different properties(columns) per product, and multiple instances(rows) of the product as well. Here's a screenshot of what I mean http://i40.tinypic.com/nbqkxc.jpg As you can see I need the structure to be completely up to the client which is where I'm getting stuck. I've started writing a custom DataSet that has "add column" & "add row" buttons, and have built a custom Table with Textboxes in each cell which builds from that dataset. I have no idea how to store the data on submit though, and to make it even more complex I need to store this in the database as a string which I think I can do by converting it to XML. Any help is appreciated, I think I just need a pointer in the right direction and am happy to do research from there. Thanks in advance. Marko

    Read the article

  • Rails does not display error messages on a form in a custom method

    - by slythic
    Hi all, I've created a custom method called checkout in my app. I create an order (which is done my adding products to my "cart"), assign it to my client, and then I head to my checkout screen where I confirm the items and enter their customer order number and complete the order (submit). Everything works great except that it doesn't display error messages. I'm able to display a flash error notice (seen in complete_order method) when things go wrong but it doesn't specify the details like a normal form would. The error messages should appear if the customer order number is not unique for that client. Below is the custom method (checkout) related code. Order Model: validates_uniqueness_of :customer_order_number, :scope => :client_id Orders_controller: def checkout @order = current_order end def complete_order @order = current_order respond_to do |format| if @order.update_attributes(params[:order]) @order.complete #sets submitted datetime and state to 'complete' flash[:notice] = 'Thank you! Your order is being processed.' format.html { redirect_to( products_path ) } format.xml { head :ok } else flash[:error] = 'Please review your items' #added to confirm an error is present format.html { redirect_to( checkout_path ) } format.xml { render :xml => @order.errors, :status => :unprocessable_entity } end end end And the form in the checkout view: <% form_for @order, :url => { :controller => "orders", :action => "complete_order" } do |f| %> <%= f.error_messages %> <%= f.text_field :customer_order_number, :label => "Purchase Order Number" %> <p> <%= f.submit 'Complete Order', :confirm => 'Are you sure?' %> <small> or <%= link_to 'cancel', current_cart_path %></small> </p> <% end %> Any idea how I can display the specific error messages? Thank you in advance! -Tony

    Read the article

  • Select box is not working properly after including google custom search box in web page

    - by Vinay
    I have got a select box and google custom search box in a page, when i choose a option from select box and navigate away from the page and again if i come back to the same page the option will not be selected (violates the default functionality of select box), The code is below <script src="https://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript"> google.load('search', '1', {language : 'en'}); google.setOnLoadCallback(function() { var customSearchControl = new google.search.CustomSearchControl('004920913350056953771:kpkclvhujzk'); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); var options = new google.search.DrawOptions(); options.setAutoComplete(true); options.enableSearchboxOnly("<?=$homeurl?>my_results.php", "query"); customSearchControl.draw('cse-search-form', options); }, true); </script> <select multiple="yes"> <option>1</option> <option>2</option> </select> If i remove the custom search script, the select box selected option will be retained even after navigating away from the page. (default functionality) Its working fine in chrome, IE but not in Firefox. Is there any solution for this, so that select box must work fine even in the presence of search box, but the order must be same 1) Search box 2)Select Box

    Read the article

  • Custom Controls Properties - C# , Forms - :(

    - by user353600
    Hi I m adding custom control to my flowlayoutpanel , its a sort of forex data , refresh every second , so on each timer tick , i m adding a control , changing controls button text , then adding it to flowlayout panel , i m doing it at each 100ms timer tick , it takeing tooo much CPU , here is my custom Control . public partial class UserControl1 : UserControl { public UserControl1() { InitializeComponent(); } private void UserControl1_Load(object sender, EventArgs e) { } public void displaydata(string name , string back3price , string back3 , string back2price , string back2 , string back1price , string back1 , string lay3price , string lay3 , string lay2price , string lay2 , string lay1price , string lay1 ) { lblrunnerName.Text = name.ToString(); btnback3.Text = back3.ToString() + "\n" + back3price.ToString(); btnback2.Text = back2.ToString() + "\n" + back2price.ToString(); btnback1.Text = back1.ToString() + "\n" + back1price.ToString(); btnlay1.Text = lay1.ToString() + "\n" + lay1price.ToString(); btnlay2.Text = lay2.ToString() + "\n" + lay2price.ToString(); btnlay3.Text = lay3.ToString() + "\n" + lay3price.ToString(); } and here is how i m adding control; private void timer1_Tick(object sender, EventArgs e) { localhost.marketData[] md; md = ser.getM1(); flowLayoutPanel1.Controls.Clear(); foreach (localhost.marketData item in md) { UserControl1 ur = new UserControl1(); ur.Name = item.runnerName + item.runnerID; ur.displaydata(item.runnerName, item.back3price, item.back3, item.back2price, item.back2, item.back1price, item.back1, item.lay3price, item.lay3, item.lay2price, item.lay2, item.lay1price, item.lay1); flowLayoutPanel1.SuspendLayout(); flowLayoutPanel1.Controls.Add(ur); flowLayoutPanel1.ResumeLayout(); } } now its happing on 10 times on each send , taking 60% of my Core2Duo cpu . is there any other way , i can just add contols first time , and then change the text of cutom controls buttons on runtime on each refresh or timer tick i m using c# .Net

    Read the article

  • Custom button with property as StaticResource

    - by alin
    I am trying to achieve the following thing: use an svg image into a custom button. In order to do this I created a Custom button: public class MainButton : Button { static MainButton() { DefaultStyleKeyProperty.OverrideMetadata(typeof(MainButton), new FrameworkPropertyMetadata(typeof(MainButton))); } public string Text { get { return (string)GetValue(TextProperty); } set { SetValue(TextProperty, value); } } public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(MainButton), new UIPropertyMetadata("")); public object Image { get { return (object)GetValue(ImageProperty); } set { SetValue(ImageProperty, value); } } public static readonly DependencyProperty ImageProperty = DependencyProperty.Register("Image", typeof(object), typeof(MainButton), new UIPropertyMetadata("")); } I took a svg file, opened it in inkscape and saved it as xaml file. I opened Themes.xaml and added the created xaml image as a ControlTemplate And the button style is: Style TargetType="{x:Type local:MainButton}" <StackPanel Canvas.Top="12" Canvas.Left="0" Canvas.ZIndex="2" Width="80"> <ContentControl x:Name="Img" Template="{StaticResource Home}" /> </StackPanel> <StackPanel x:Name="spText" Canvas.Top="45" Canvas.Left="1" Canvas.ZIndex="1" Width="80"> <TextBlock x:Name="Txt" Text="{Binding Path=(local:MainButton.Text), RelativeSource ={RelativeSource FindAncestor, AncestorType ={x:Type Button}}}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontSize="14"/> </StackPanel> ... As you can see I have hardcoded the StaticResource name I want to be able to have a binding with property Image on this Template, something like So that I can set the Image property of the button with the name of the StaticResource I want. For example, having beside "Home" image, another one "Back" I would have two buttons in MainWindow declared like this: Any advice is kindly taken. Thank you for your time.

    Read the article

  • Custom Server to communicate with my software?

    - by Zachary Brown
    I am working on a major project that I need for work. I am working on a project that requires software validation. I would like this to be handled by a custom server I will write in Python, this server will be the "gateway" between the user and product activation. The software program will be purchased from other companies in volume licensing. So this is what I need the server to do: 1). The user clicks to activate their software. (easy, all is good so far) 2). The software gets the distributor's id from another online server. ( this is also easy, and already coded.) 3). Then, the software asks my custom server if the distributor is allowed to activate anymore copies of the software. 4). The server will then check ( an online encoded text file ) to see if the distributor can or can't. If they can, it will tell the software that registration can proceede, at which point the software will pass the software serial number to the server. I have done my best to explain what I am trying to accomplish, but if something is not quite sensible, please let me know. Thanks to all members of Stackoverflow.com for the help in the past, and those who will help me now. I am using Python 2.6 Win. XP Home Edition

    Read the article

  • How can I theme custom form(drupal 6.x)

    - by Andrew
    DRUPAL 6.X I have this custom form constructor inside my custom module which is invoke through ajax request. I’m attempting to theme this form with the template file reside in my theme directory. For that matter, I’ve registered my theme inside template.php file which reside in my theme folder. Here’s how this file looks – function my_theme() { return array( 'searchdb' => array( 'arguments' => array('form' => NULL), 'template' => 'searchform', ) ); } And the following is the excerpt of module code – function test_menu() { $my_form['searchdb'] = array( 'title' => 'Search db', 'page callback' => 'get_form', 'page arguments' => array(0), 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); return $my_form; } function get_form($formtype){ switch($formtype){ case 'searchdb' : echo drupal_get_form('searchdb'); break; } } function searchdb(){ $form['customer_name'] = array( '#type' => 'textfield', '#title' => t('Customer Name'), '#size' => 50, '#attributes' => array('class' => 'name-textbox'), ); return $form; } As you can imagine, this is not working at all. Just to test if my theme is even registered, I’ve also tested with theme function but, it’s not called. I've checked template file name and form-id(through the outputted html source) and everything seems ok. I would be glad if anyone could point me to the right direction.

    Read the article

  • Black Screen: How to set Projection/View Matrix

    - by Lisa
    I have a Windows Phone 8 C#/XAML with DirectX component project. I'm rendering some particles, but each particle is a rectangle versus a square (as I've set the vertices to be positions equally offset from each other). I used an Identity matrix in the view and projection matrix. I decided to add the windows aspect ratio to prevent the rectangles. But now I get a black screen. None of the particles are rendered now. I don't know what's wrong with my matrices. Can anyone see the problem? These are the default matrices in Microsoft's project example. View Matrix: XMVECTOR eye = XMVectorSet(0.0f, 0.7f, 1.5f, 0.0f); XMVECTOR at = XMVectorSet(0.0f, -0.1f, 0.0f, 0.0f); XMVECTOR up = XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f); XMStoreFloat4x4(&m_constantBufferData.view, XMMatrixTranspose(XMMatrixLookAtRH(eye, at, up))); Projection Matrix: void CubeRenderer::CreateWindowSizeDependentResources() { Direct3DBase::CreateWindowSizeDependentResources(); float aspectRatio = m_windowBounds.Width / m_windowBounds.Height; float fovAngleY = 70.0f * XM_PI / 180.0f; if (aspectRatio < 1.0f) { fovAngleY /= aspectRatio; } XMStoreFloat4x4(&m_constantBufferData.projection, XMMatrixTranspose(XMMatrixPerspectiveFovRH(fovAngleY, aspectRatio, 0.01f, 100.0f))); } I've tried modifying them to use cocos2dx's WP8 example. XMMATRIX identityMatrix = XMMatrixIdentity(); float fovy = 60.0f; float aspect = m_windowBounds.Width / m_windowBounds.Height; float zNear = 0.1f; float zFar = 100.0f; float xmin, xmax, ymin, ymax; ymax = zNear * tanf(fovy * XM_PI / 360); ymin = -ymax; xmin = ymin * aspect; xmax = ymax * aspect; XMMATRIX tmpMatrix = XMMatrixPerspectiveOffCenterRH(xmin, xmax, ymin, ymax, zNear, zFar); XMMATRIX projectionMatrix = XMMatrixMultiply(tmpMatrix, identityMatrix); // View Matrix float fEyeX = m_windowBounds.Width * 0.5f; float fEyeY = m_windowBounds.Height * 0.5f; float fEyeZ = m_windowBounds.Height / 1.1566f; float fLookAtX = m_windowBounds.Width * 0.5f; float fLookAtY = m_windowBounds.Height * 0.5f; float fLookAtZ = 0.0f; float fUpX = 0.0f; float fUpY = 1.0f; float fUpZ = 0.0f; XMMATRIX tmpMatrix2 = XMMatrixLookAtRH(XMVectorSet(fEyeX,fEyeY,fEyeZ,0.f), XMVectorSet(fLookAtX,fLookAtY,fLookAtZ,0.f), XMVectorSet(fUpX,fUpY,fUpZ,0.f)); XMMATRIX viewMatrix = XMMatrixMultiply(tmpMatrix2, identityMatrix); XMStoreFloat4x4(&m_constantBufferData.view, viewMatrix); Vertex Shader cbuffer ModelViewProjectionConstantBuffer : register(b0) { //matrix model; matrix view; matrix projection; }; struct VertexInputType { float4 position : POSITION; float2 tex : TEXCOORD0; float4 color : COLOR; }; struct PixelInputType { float4 position : SV_POSITION; float2 tex : TEXCOORD0; float4 color : COLOR; }; PixelInputType main(VertexInputType input) { PixelInputType output; // Change the position vector to be 4 units for proper matrix calculations. input.position.w = 1.0f; //===================================== // TODO: ADDED for testing input.position.z = 0.0f; //===================================== // Calculate the position of the vertex against the world, view, and projection matrices. //output.position = mul(input.position, model); output.position = mul(input.position, view); output.position = mul(output.position, projection); // Store the texture coordinates for the pixel shader. output.tex = input.tex; // Store the particle color for the pixel shader. output.color = input.color; return output; } Before I render the shader, I set the view/projection matrices into the constant buffer void ParticleRenderer::SetShaderParameters() { ViewProjectionConstantBuffer* dataPtr; D3D11_MAPPED_SUBRESOURCE mappedResource; DX::ThrowIfFailed(m_d3dContext->Map(m_constantBuffer.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource)); dataPtr = (ViewProjectionConstantBuffer*)mappedResource.pData; dataPtr->view = m_constantBufferData.view; dataPtr->projection = m_constantBufferData.projection; m_d3dContext->Unmap(m_constantBuffer.Get(), 0); // Now set the constant buffer in the vertex shader with the updated values. m_d3dContext->VSSetConstantBuffers(0, 1, m_constantBuffer.GetAddressOf() ); // Set shader texture resource in the pixel shader. m_d3dContext->PSSetShaderResources(0, 1, &m_textureView); } Nothing, black screen... I tried so many different look at, eye, and up vectors. I tried transposing the matrices. I've set the particle center position to always be (0, 0, 0), I tried different positions too, just to make sure they're not being rendered offscreen.

    Read the article

  • Custom UIViewController is not responsive to device rotation

    - by Wayne Lo
    I have a custom UIViewController, which is the only subView of UIView. The UIViewController contains delegate function: (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } This function is called once when the application starts and is never called again when the device is rotated. I also notice that the willRotateToInterfaceOrientation function is never called. I pretty much commented out all the content in the UIViewController but it is still not responding to device rotation.

    Read the article

  • iPhone SDK / Facebook Connect: Using a custom login dialog

    - by boliva
    Exactly what the title says. Is it possible to use Facebook Connect (or any other means of FB integration) in a native iPhone app without resorting to the built in login dialog (which looks awful)? Something where I could create my own custom login screen asking for the facebook login username and password and then using the fbconnect native methods to validate that info and retrieve a valid session?

    Read the article

  • Wordpress, WP_Query with custom taxonomy and custom post type

    - by Chris
    This code gets 10 posts of all types that are linked to the term_name; global $wp_query; query_posts( array( "taxonomy_name" => "term_name", 'showposts' => 10 ) ); This code gets 10 posts of custom post type "message"; global $wp_query; query_posts( array( 'post_type' => 'message' 'showposts' => 10 ) ); This code however always ignores the post_type requirement but still selects all post types linked to the term_name; global $wp_query; query_posts( array( 'post_type' => 'message' , "taxonomy_name" => "term_name", 'showposts' => 10 ) ); I can't see how both can work individually but together they don't unless it might be a bug - any thoughts?

    Read the article

  • Insert custom TypeConverter on a property at runtime, from inside a custom UITypeEditor

    - by Pedery
    I've created a custom UITypeEditor. Can I possibly insert an attribute that also attaches a TypeConverter to my property from inside the UITypeEditor class? I've tried the following, but nothing happens, no matter how I twist and turn it: Attribute[] newAttributes = new Attribute[1]; newAttributes[0] = new TypeConverterAttribute(typeof(BooleanConverter)); Now, the above needs to have the following attached to it somehow: TypeDescriptor.AddAttributes(context.Instance.PROPERTYNAME, newAttributes); ...but first of all I don't know how to get to the property in question in a generic way, and all code I try just fails. Even if I try to assign the TypeConverter in this manner globally, it fails. (Setting it as an attribute on the property itself works though, just to rule out that the bug is in that part.)

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >