我想在XNA中绘制一个Model.我已经领先并在Blender中生成它并将其导出为fbx文件格式,以便内容管道可以使用它.我应该在WindowsGame()的Draw()方法中添加什么代码?我已经尝试过以下但是我得到的只是一个灰色的屏幕(灰色不是蓝色,这是清晰的颜色,请注意)模型是使用content.Load导入的,这不会引起任何错误,我称之为"碗" .
任何人都可以告诉我为什么这里不起作用?
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
BasicEffect b = new BasicEffect (graphics.GraphicsDevice, new EffectPool ( ));
foreach (ModelMesh m in Bowl.Meshes)
{
b.View = Cam.mView;
b.Projection = Cam.mProj;
b.World = mWorld;
b.EnableDefaultLighting ( );
b.Begin ( );
m.Draw ( );
b.End ( );
}
base.Draw(gameTime);
}
Run Code Online (Sandbox Code Playgroud)
我刚刚注意到这相当于谋杀效率,但我已经尝试了很多东西,我只是需要它才能优化它.
拖动图像时,按住鼠标时会出现一个半透明的重影图像.
是否有某种方法可以应用CSS/JS来消除某个部分的效果?
我的工作进展缓慢,不断尝试不同的方法。
快问...
是否可以将 .fadein .fadeout .slideup .slidedown 等 jquery 动画效果添加到 onclick .load。
当我点击一个链接时,页面只是在我指定的区域加载,但我不知道如何将效果绑定到这个 .load。
有什么建议?
编辑:代码示例:
$(document).ready(function(){
// load home page when the page loads
$("#main_content_inner").load("home.html");
$("#page1").click(function(){
// load page1 in main_content_inner on click
$("#main_content_inner").load("page1.html");
});
$("#page2").click(function(){
// load page2 in main_content_inner on click
$("#main_content_inner").load("page2.html");
});
$("#page3").click(function(){
// load page3 in main_content_inner on click
$("#content").load("page3.html");
});
});
Run Code Online (Sandbox Code Playgroud)
编辑:来自 HTML 文件的片段:
//页面应该显示在哪里
<div id="main_content_inner">
<h1>
Main Content
</h1>
</div>
Run Code Online (Sandbox Code Playgroud)
//用户选择页面的侧边栏菜单
<ul id="sidebar_menu">
<p><li id="page1"> page1</li></p>
<p><li id="page2"> page2</li></p>
<p><li id="page3"> page3</li></p> …Run Code Online (Sandbox Code Playgroud) 假设元素值为55:
<span id="some">55</span>
Run Code Online (Sandbox Code Playgroud)
我想要:
所以我尝试过:
$("#some").fadeOut("slow").html("44").fadeIn("slow");
Run Code Online (Sandbox Code Playgroud)
但是上面首先将跨度的内容设置为44,然后淡出并淡入.
所以我尝试了一个回调:
function fadeOutComplete(){
$("#some").html("<%= @cc %>").fadeIn("slow");
}
$("#some").fadeOut("slow",fadeOutComplete);
Run Code Online (Sandbox Code Playgroud)
现在这个工作,但它的外观和感觉笨重.有没有办法写这个DRYer和更多jQuery-er?(甚至不确定我的意思是jQuery-er!)
我怎样才能传入要设置其值的元素和要设置的值,fadeOutComplete以便我可以将该回调排序为泛型?
我正在尝试在Gallery视图上创建预览效果并遇到Gallery.getChildAt(int position)的问题,它在大多数时间返回null.它应该仅在未显示子项时返回null,这不是这里的情况,因为用户需要滚动它.有没有办法解决这个问题,还是应该改变我的做法?这是我的代码:
gallery.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent event) {
if(event.getAction()==MotionEvent.ACTION_UP){
preview_container.setVisibility(View.GONE);
}
else if(event.getDownTime()>2500){
int position = gallery.pointToPosition((int)event.getX(), (int)event.getY());
if (position!=AdapterView.INVALID_POSITION){
View child = gallery.getChildAt(position);
if(child!=null){
Bitmap tmp_bitmap = book.imageForPreview(position);
previewImg.setImageBitmap(tmp_bitmap);
FrameLayout.LayoutParams layout = new FrameLayout.LayoutParams(tmp_bitmap.getWidth()+2, tmp_bitmap.getHeight()+2,Gravity.NO_GRAVITY);
int[] coord = new int[2];
child.getLocationOnScreen(coord);
int y = MMBookReader.this.getWindowManager().getDefaultDisplay().getHeight()-(tmp_bitmap.getHeight()+view.getHeight());
int x = (int) coord[0]-(tmp_bitmap.getWidth()-child.getWidth())/2;
layout.leftMargin=x;
layout.topMargin=y;
preview_container.setVisibility(View.VISIBLE);
preview_container.setLayoutParams(layout);
previewPageCount.setText(book.getMmpages().get(position).getPosition()+"/"+book.getPages());
}
}
else
preview_container.setVisibility(View.GONE);
}
return false;
}
});
Run Code Online (Sandbox Code Playgroud)
编辑:我不是要填充Gallery视图,我已经完成了这部分,并且非常了解Adapter类的使用.
编辑2:通过更改行解决:
View child = gallery.getChildAt(position);
Run Code Online (Sandbox Code Playgroud)
用:
View child = …Run Code Online (Sandbox Code Playgroud) 我有以下块:
$('.new_comment').live('ajax:success', function(evt, data, status, xhr){
$('.comments article:last').after(xhr.responseText).effect("highlight", {}, 3000);
})
Run Code Online (Sandbox Code Playgroud)
因此,当new_comment提交表单时,它会调用它.
该after()函数工作正常,但effect()调用抛出此错误:
TypeError: 'undefined' is not a function (evaluating '$('.comments article:last').after(xhr.responseText).effect("highlight", {}, 3000)')
Run Code Online (Sandbox Code Playgroud)
我正在使用jQuery 1.7.1和jQuery UI 1.8.16.
UPDATE: xhr.responseText返回一个新创建的article元素,如下所示:
<article id="2">
<h6><a href="#">Joe</a> <span>(<a href="#2">less than a minute ago</a>)</span></h6>
<p>This is the new comment!</p>
</article>
Run Code Online (Sandbox Code Playgroud)
添加之后,.commentsDOM看起来像这样:
<section class="comments">
<h3>Comments</h3>
<article id="1">
<h6><a href="#">Joe</a> <span>(<a href="#1">less than a minute ago</a>)</span></h6>
<p>This is a comment!</p>
</article>
<article id="2">
<h6><a href="#">Joe</a> …Run Code Online (Sandbox Code Playgroud) 有谁知道MAC OSx上有Genie动画线的iPad实现吗?我想在左侧创建一些列表,并在动作上制作"像OSx"Genie动画,将动态细节部分设置为列表项(如将MAC上的窗口最小化到停靠栏图标)
谢谢!
我有一个问题.我需要应用一个类似于Pixelate or Blur整个过滤器UIView.喜欢的eBay iPad应用程序.
我想用,GPUImage但我不知道怎么做.有一种方法可以GPUImageView直接应用过滤器而不通过a UIImage?
主要问题是UIView在iPad3日制作大型屏幕截图是昂贵的(UIWindow抓取时间为2秒).因此,完美的解决方案是直接将过滤器应用于视图,就像eBay应用程序一样,但是......如何?
谢谢大家!
如果已经写了一个包含图像和文本的按钮usercontrol.
当用户将鼠标移到按钮上时,我想要对图像产生影响.
现在我可以让它对按钮产生影响.
这是我到目前为止:
<Button x:Class="Example.Controls.MyButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Name="MyButtonControl"
Margin="5"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
d:DesignHeight="80"
d:DesignWidth="120"
Style="{DynamicResource SomeButtonStyle}"
mc:Ignorable="d">
<Button.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources.xaml" />
<ResourceDictionary>
<Style x:Key="SomeButtonStyle"
BasedOn="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
TargetType="Button">
<Style.Triggers>
<Trigger Property="Button.IsMouseOver" Value="True">
<Setter Property="Button.Effect">
<Setter.Value>
<DropShadowEffect BlurRadius="30"
Opacity="100"
ShadowDepth="0"
Color="WhiteSmoke" />
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Button.Resources>
<Border HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
BorderBrush="SlateGray"
BorderThickness="1">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="5*" />
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*" />
<ColumnDefinition Width="9*" />
<ColumnDefinition Width="3*" /> …Run Code Online (Sandbox Code Playgroud) 我正在寻找一种简单的方法,使用单个标签(仅<a>)在边框上创建倾斜效果,但保持文本的原样。
我会知道如何处理内部或外部的跨度,但我不想在页面上有额外的、几乎为零的 HTML。
下面举例。

effect ×10
jquery ×3
animation ×2
css ×2
ios ×2
ajax ×1
android ×1
blender ×1
button ×1
c# ×1
filter ×1
gallery ×1
gpuimage ×1
highlight ×1
javascript ×1
jquery-ui ×1
load ×1
objective-c ×1
preview ×1
skew ×1
styles ×1
templates ×1
touch-event ×1
transition ×1
triggers ×1
wpf ×1
xaml ×1
xna ×1